From 8010e3197ecf19db28e54ee10d2257310ce6f03a Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Wed, 26 Dec 2018 15:54:11 +0100 Subject: [PATCH] Allow videos to block rotation until they're finished --- 35c3-video/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/35c3-video/index.html b/35c3-video/index.html index 438ebc3..b397097 100644 --- a/35c3-video/index.html +++ b/35c3-video/index.html @@ -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');