From a1a101c0f19fc1cae45c935d32f2d229f2cd58f3 Mon Sep 17 00:00:00 2001 From: knotteye Date: Fri, 8 Jan 2021 17:25:44 -0600 Subject: [PATCH] Check if the video object still exists before restarting the timeout --- site/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/index.js b/site/index.js index 3cb75d7..56ad90c 100644 --- a/site/index.js +++ b/site/index.js @@ -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); } }