diff --git a/css/player-base.js b/css/player-base.js index 64063fcd..eb195172 100644 --- a/css/player-base.js +++ b/css/player-base.js @@ -3,11 +3,9 @@ var _yt_player = videojs; - - - -document.addEventListener('DOMContentLoaded', () => { - const qs = new URLSearchParams(location.search); + document.addEventListener('DOMContentLoaded', () => { + // delete progress key like "progress-" + const qs = new URLSearchParams(location.search); const vidKey = qs.get('v') || ''; if (vidKey) { try { localStorage.removeItem(`progress-${vidKey}`); } catch {} } @@ -18,10 +16,14 @@ document.addEventListener('DOMContentLoaded', () => { preload: 'auto' }); - const MPD_URL = window.mpdurl || ''; + // enable contrib-quality-levels + source selector + player.httpSourceSelector(); + player.controlBar.addChild('QualitySelector'); + + // Use your global window.mpdurl + const MPD_URL = window.mpdurl || ''; if (MPD_URL) { player.ready(() => { - // dash.js will handle this type player.src({ src: MPD_URL, type: 'application/dash+xml' }); }); } else { @@ -47,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => { }); + // hai!! if ur asking why are they here - its for smth in the future!!!!!!