diff --git a/index.js b/index.js index 1a0537d..cbfeb38 100644 --- a/index.js +++ b/index.js @@ -102,6 +102,7 @@ const createVidList = () => { var hls = null; var currentVideoIndex = 0; +var firstRun = true; if(window.location.hash) { let hash = window.location.hash; if(hash.startsWith('#playlistEntry')) { @@ -113,9 +114,12 @@ if(window.location.hash) { } const changeVid = index => { - if (index === currentVideoIndex){ + if (index === currentVideoIndex && !firstRun){ return; } + if(firstRun) { + firstRun = false; + } let oldSelectedVideo = document.querySelector(`#playlistEntry${currentVideoIndex}`); oldSelectedVideo.classList.remove("bg-dark"); oldSelectedVideo.classList.remove("text-light");