Fix first run
This commit is contained in:
6
index.js
6
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");
|
||||
|
||||
Reference in New Issue
Block a user