Attempt to fix videos not autoplaying on Mobile Safari
Fallback onClick to play in case it really still doesn't autoplay
This commit is contained in:
parent
0289d20d8b
commit
299b638ac3
|
@ -126,12 +126,19 @@ function Media({ media, showOriginal, onClick }) {
|
|||
poster={previewUrl}
|
||||
width={width}
|
||||
height={height}
|
||||
preload
|
||||
preload="auto"
|
||||
autoplay
|
||||
muted={isGIF}
|
||||
controls={!isGIF}
|
||||
playsinline
|
||||
loop
|
||||
onClick={() => {
|
||||
if (isGIF) {
|
||||
try {
|
||||
videoRef.current?.play();
|
||||
} catch (e) {}
|
||||
}
|
||||
}}
|
||||
></video>
|
||||
) : isGIF ? (
|
||||
<video
|
||||
|
@ -140,7 +147,7 @@ function Media({ media, showOriginal, onClick }) {
|
|||
poster={previewUrl}
|
||||
width={width}
|
||||
height={height}
|
||||
preload
|
||||
preload="auto"
|
||||
// controls
|
||||
playsinline
|
||||
loop
|
||||
|
|
Loading…
Reference in a new issue