mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-11-03 19:17:16 -05:00 
			
		
		
		
	Fix firefox play/pause loop
This commit is contained in:
		
							parent
							
								
									735edf1529
								
							
						
					
					
						commit
						3f928ad507
					
				@ -97,6 +97,7 @@ const Video = forwardRef<{ seek: (value: number) => void }, VideoProps>(function
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	useEffect(() => {
 | 
			
		||||
		if (!ref.current || paused === ref.current.paused) return;
 | 
			
		||||
		if (paused) ref.current?.pause();
 | 
			
		||||
		else ref.current?.play().catch(() => { });
 | 
			
		||||
	}, [paused]);
 | 
			
		||||
@ -186,8 +187,9 @@ const Video = forwardRef<{ seek: (value: number) => void }, VideoProps>(function
 | 
			
		||||
					});
 | 
			
		||||
				}
 | 
			
		||||
			}}
 | 
			
		||||
			onPlay={() => onPlayPause?.call(null, true)}
 | 
			
		||||
			onPause={() => onPlayPause?.call(null, false)}
 | 
			
		||||
			// BUG: If this is enabled, switching to fullscreen or opening a menu make a play/pause loop until firefox crash.
 | 
			
		||||
			// onPlay={() => onPlayPause?.call(null, true)}
 | 
			
		||||
			// onPause={() => onPlayPause?.call(null, false)}
 | 
			
		||||
			onEnded={onEnd}
 | 
			
		||||
			{...css({ width: "100%", height: "100%" })}
 | 
			
		||||
		/>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user