Allow videos to block rotation until they're finished

This commit is contained in:
Henri Bergius 2018-12-26 15:54:11 +01:00
parent 8bc5c1167a
commit 8010e3197e

View file

@ -62,6 +62,10 @@
video.setAttribute('src', prefix + file + '.mp4');
video.autoplay = true;
video.loop = true;
video.addEventListener('playing', function () {
var now = new Date();
window.waitUntil = now.getTime() + ((video.duration - video.currentTime) * 1000);
});
document.body.appendChild(video);
var time = document.getElementById('current-time');