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