mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 08:48:47 +01:00
Another attempt at fixing GIF not autoplaying on Mobile Safari
This commit is contained in:
parent
c8ea2e8703
commit
9278645069
2 changed files with 14 additions and 8 deletions
|
@ -374,6 +374,7 @@
|
||||||
}
|
}
|
||||||
.status .media-gif video {
|
.status .media-gif video {
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
.status .media-audio {
|
.status .media-audio {
|
||||||
border: 0;
|
border: 0;
|
||||||
|
|
|
@ -755,14 +755,19 @@ function Media({ media, showOriginal, onClick = () => {} }) {
|
||||||
rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,
|
rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,
|
||||||
}}
|
}}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
if (showOriginal && isGIF) {
|
if (isGIF) {
|
||||||
try {
|
// Hmm, the videoRef might conflict here
|
||||||
if (videoRef.current.paused) {
|
if (showOriginal) {
|
||||||
videoRef.current.play();
|
try {
|
||||||
} else {
|
if (videoRef.current.paused) {
|
||||||
videoRef.current.pause();
|
videoRef.current.play();
|
||||||
}
|
} else {
|
||||||
} catch (e) {}
|
videoRef.current.pause();
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
} else {
|
||||||
|
videoRef.current.pause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onClick(e);
|
onClick(e);
|
||||||
}}
|
}}
|
||||||
|
|
Loading…
Reference in a new issue