mirror of
				https://gitea.invidious.io/iv-org/invidious.git
				synced 2024-08-15 00:53:41 +00:00 
			
		
		
		
	Fix iOS screen timeout on video playback loop mode
This commit is contained in:
		
							parent
							
								
									ac0c0609bb
								
							
						
					
					
						commit
						2a092577c6
					
				
					 1 changed files with 15 additions and 0 deletions
				
			
		|  | @ -701,6 +701,21 @@ 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()); | ||||||
|  |             } | ||||||
|  |         }); | ||||||
|  |     }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| // Watch on Invidious link
 | // Watch on Invidious link
 | ||||||
| if (location.pathname.startsWith('/embed/')) { | if (location.pathname.startsWith('/embed/')) { | ||||||
|     const Button = videojs.getComponent('Button'); |     const Button = videojs.getComponent('Button'); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue