Another attempt to fix GIFV not auto-playing on Mobile Safari

This commit is contained in:
Lim Chee Aun 2022-12-11 11:20:24 +08:00
parent bc4551583b
commit 9ad956049b

View file

@ -95,7 +95,14 @@ function Media({ media, showOriginal, onClick }) {
style={{
backgroundColor: `rgb(${rgbAverageColor.join(',')})`,
}}
onClick={onClick}
onClick={(e) => {
if (isGIF) {
try {
videoRef.current?.pause();
} catch (e) {}
}
onClick(e);
}}
onMouseEnter={() => {
if (isGIF) {
try {