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