mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 05:11:55 +01:00
Video: Fix auto-pausing on iOS
This commit is contained in:
parent
41f2c3e26b
commit
ea6c28a5de
@ -15,11 +15,11 @@ export default function useVideoAutoPause(playerRef: { current: HTMLVideoElement
|
||||
return;
|
||||
}
|
||||
|
||||
if (!wasPlaying.current) {
|
||||
wasPlaying.current = !playerRef.current.paused;
|
||||
}
|
||||
|
||||
if (wasPlaying.current) {
|
||||
playerRef.current.pause();
|
||||
}
|
||||
}, [playerRef]);
|
||||
|
||||
const unfreezePlaying = useCallback(() => {
|
||||
@ -30,8 +30,6 @@ export default function useVideoAutoPause(playerRef: { current: HTMLVideoElement
|
||||
) {
|
||||
safePlay(playerRef.current);
|
||||
}
|
||||
|
||||
wasPlaying.current = false;
|
||||
}, [playerRef]);
|
||||
|
||||
const unfreezePlayingOnRaf = useCallback(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user