Allow GIFs play on focus/blur too

This commit is contained in:
Lim Chee Aun 2023-09-29 21:02:29 +08:00
parent ac14e61b6d
commit 3042dea886

View file

@ -321,6 +321,20 @@ function Media({ media, to, showOriginal, autoAnimate, onClick = () => {} }) {
} catch (e) {}
}
}}
onFocus={() => {
if (hoverAnimate) {
try {
videoRef.current.play();
} catch (e) {}
}
}}
onBlur={() => {
if (hoverAnimate) {
try {
videoRef.current.pause();
} catch (e) {}
}
}}
>
{showOriginal || autoGIFAnimate ? (
isGIF && showOriginal ? (