Exempt gifs from active video system (#9824)

This commit is contained in:
Samuel Newman
2026-02-04 22:37:09 +02:00
committed by GitHub
parent e6c4a539ca
commit 3abc361800
2 changed files with 23 additions and 9 deletions
@@ -130,13 +130,14 @@ export function Controls({
const autoplayDisabled = useAutoplayDisabled() || isWithinMessage
useEffect(() => {
if (active) {
if (onScreen) {
// GIFs play immediately, videos wait until onScreen
if (onScreen || isGif) {
if (!autoplayDisabled) play()
} else {
pause()
}
}
}, [onScreen, pause, active, play, autoplayDisabled])
}, [onScreen, pause, active, play, autoplayDisabled, isGif])
// use minimal quality when not focused
useEffect(() => {