kopia lustrzana https://github.com/cheeaun/phanpy
Allow GIFs play on focus/blur too
rodzic
ac14e61b6d
commit
3042dea886
|
@ -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 ? (
|
||||||
|
|
Ładowanie…
Reference in New Issue