diff --git a/tpl/_footer.php b/tpl/_footer.php index 98f0a4f..19c5e9b 100644 --- a/tpl/_footer.php +++ b/tpl/_footer.php @@ -45,7 +45,7 @@ whenReady(function () { //ExtensionData.vidStatus = 'off'; video.pause(); video.src = ""; - localstream.getTracks()[0].stop(); + if (localstream) localstream.getTracks()[0].stop(); //console.log("Vid off"); } @@ -109,6 +109,11 @@ whenReady(function () { video.setAttribute("playsinline", true); // required to tell iOS safari we don't want fullscreen video.play(); requestAnimationFrame(tick); + }).catch(function () { + gebi('app').style.display = 'block'; + gebi('qrscanner').style.display = 'none'; + gebi('qrcode').focus(); + videoOff(); }); event.preventDefault();