I just can't seem to locate what's wrong with this video snippet.
<video poster="sample.jpg" loop autoplay controls muted playsinline>
<source type="video/webm" src="sample.webm"></source>
<source type="video/mp4" src="sample.mp4"></source>
</video>
The video plays without any problems in Safari (haven't tested against earlier versions of iOS, but my only concern there is the autoplay issue?), but on Chrome the only thing I see is the cover image and a play button that doesn't trigger anything. Am I missing something? Do I really need to use JS to get it to work?
Update: It seems there's an issue with playing Webm files with iOS Chrome - I've tried several files from different locations and they seem to be needed to be downloaded first before being able to play.
Accumulated data in the form of cache and cookies tend to prevent videos from playing on Chrome. Get rid of these corrupted cookies, history, passwords, and any other browsing data, to free up space for new videos to load and play.
Clear Browsing Data Overwhelming browsing data can also affect Chrome's performance on your phone and lead to such anomalies. In that case, you can try clearing the existing cache and cookies stored by Chrome to fix the issue.
Clear Safari History and Data You can try clearing existing browsing data to see if that fixes the videos not playing issue on iPhone. Step 1: Open up Settings on your iPhone and navigate to Safari. Step 2: Tap on the Clear History and Website Data option. Choose Clear History and Data when prompted.
If videos are not playing on your iPad, there could be a case that you're using an older version of your video playing apps or an outdated OS on your iPad. Updating all iPad apps and OS will hopefully rid your device of its issues.
Google Chrome currently has a bug in which it will not autoplay a
.webm
video if it comes after anything else. Try to use a code published here.
Build an HTML5 video
as usual:
<video playsinline autoplay muted loop poster="aurora.jpg" id="bgvid">
<source src="aurora.webm" type="video/webm"> </source>
<source src="aurora.mp4" type="video/mp4"> </source>
</video>
If previous advise does not help, try to use scripted playback examples video.js and simpl on Github.
Also, read this post dedicated to muted autoplay in mobile browsers. And it must be useful to read Stack Overflow post as well – Efficiently detect if a device will play silent videos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With