mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Allow GIFs play on focus/blur too
This commit is contained in:
parent
ac14e61b6d
commit
3042dea886
1 changed files with 14 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue