mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-28 00:17:25 +00:00
Fix iOS screen timeout on video playback loop mode (more elegantly)
This commit is contained in:
parent
2a092577c6
commit
27d8fa112d
@ -704,14 +704,10 @@ if (navigator.vendor === 'Apple Computer, Inc.' && video_data.params.listen) {
|
|||||||
// Safari screen timeout on looped video playback fix
|
// Safari screen timeout on looped video playback fix
|
||||||
if (navigator.vendor === 'Apple Computer, Inc.' && !video_data.params.listen && video_data.params.video_loop) {
|
if (navigator.vendor === 'Apple Computer, Inc.' && !video_data.params.listen && video_data.params.video_loop) {
|
||||||
player.loop(false);
|
player.loop(false);
|
||||||
player.on('loadedmetadata', function () {
|
player.ready(function () {
|
||||||
player.on('timeupdate', function () {
|
player.on('ended', function () {
|
||||||
if (player.remainingTime() < 2) {
|
player.currentTime(0);
|
||||||
player.loop(true);
|
player.play();
|
||||||
setTimeout(() => {
|
|
||||||
player.loop(false);
|
|
||||||
}, 2000 / player.playbackRate());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user