Allow GIFs play on focus/blur too
This commit is contained in:
parent
ac14e61b6d
commit
3042dea886
|
@ -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 ? (
|
||||
|
|
Loading…
Reference in a new issue