Reputation: 133
I'm trying to autoplay a video on iOS's Safari (any version) and I'm using this HTML5 tag:
<video
autoPlay="true"
loop="true"
muted="true"
playsInline="true"
poster="/assets/pictures/poster.jpg"
src="https://myURL"
className="stage-vid"
/>
For some reason it works on Chrome and on Firefox but when I check the video's .muted
property on Chrome is set to true while in Safari is set to false. I'm using Browserstack for debugging but I tried it on an iOS device and the video is not playing even when that video doesn't even have an audio track.
Thanks a lot
Upvotes: 5
Views: 17171
Reputation: 95
Did you try to write:
<video muted playsinline />
or:
<video muted="muted" playsinline="playsinline" />
?
Autoplay is possible on iOS as stated here on Apple's docs
There might be other cases such as Low-power mode that will block autoplay or lower MEI if it's on Chrome.
Upvotes: 8
Reputation: 99
unfortunately, iOS blocks autoplay. The play function needs to be triggered from a click or touch event. Simulated clicks or touches does not work either. Im afraid there is nothing to do about this due to it depends on Apple.
Upvotes: 1