fix: podpora zarizeni, ktere nemaji video

This commit is contained in:
severak 2020-03-05 14:19:59 +01:00
parent e0dc13ccdc
commit 8303276819
1 changed files with 6 additions and 1 deletions

View File

@ -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();