Don't re-set waitUntil
This commit is contained in:
parent
8010e3197e
commit
d0fd2bda1b
2 changed files with 6 additions and 0 deletions
|
@ -63,6 +63,9 @@
|
||||||
video.autoplay = true;
|
video.autoplay = true;
|
||||||
video.loop = true;
|
video.loop = true;
|
||||||
video.addEventListener('playing', function () {
|
video.addEventListener('playing', function () {
|
||||||
|
if (window.waitUntil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
window.waitUntil = now.getTime() + ((video.duration - video.currentTime) * 1000);
|
window.waitUntil = now.getTime() + ((video.duration - video.currentTime) * 1000);
|
||||||
});
|
});
|
||||||
|
|
|
@ -63,6 +63,9 @@
|
||||||
video.autoplay = true;
|
video.autoplay = true;
|
||||||
video.loop = true;
|
video.loop = true;
|
||||||
video.addEventListener('playing', function () {
|
video.addEventListener('playing', function () {
|
||||||
|
if (window.waitUntil) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
window.waitUntil = now.getTime() + ((video.duration - video.currentTime) * 1000);
|
window.waitUntil = now.getTime() + ((video.duration - video.currentTime) * 1000);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue