Allow GIFs play on focus/blur too

pull/228/head
Lim Chee Aun 2023-09-29 21:02:29 +08:00
rodzic ac14e61b6d
commit 3042dea886
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

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