Check if the video object still exists before restarting the timeout

pull/21/head
knotteye 2021-01-08 17:25:44 -06:00
parent 7f40690820
commit a1a101c0f1
1 changed files with 5 additions and 1 deletions

View File

@ -102,12 +102,15 @@ async function render(path, s){
//root
case "/":
render('/users/live');
modifyLinks();
break;
case "":
render('/users/live');
modifyLinks();
break;
case "/index.html":
render('/users/live');
modifyLinks();
break;
//404
default:
@ -215,7 +218,8 @@ async function initPlayer(usr) {
onError(e);
}
} else {
setTimeout(initPlayer, 5000, usr);
if(document.getElementById('video') !== null)
setTimeout(initPlayer, 5000, usr);
}
}