Html5 Video Autoplay Not Working In Chrome
Solution 1:
As per Google's latest policies, Muted videos can autoplay in Chrome. Autoplay with sound is allowed if:
- User has interacted with the domain (click, tap, etc.).
- On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
- On mobile, the user has [added the site to their home screen].
Top frames can delegate autoplay permission to their iframes to allow autoplay with sound.
Also, put the following tag after your <source>
tag:-
<source src="assets/watertuin.ogg"type="video/ogg">
See, if it works now.
Check more about Google autoplay policy changes on:- https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
Solution 2:
Ended up here because I was having the same issue (no mp4 autoplay in Chrome despite it working in Firefox & Safari). This is what fixed it for me:
$('#video')[0].load();
Hopefully this may help somebody else. My HTML:
<video id="video" class="video" autoplay muted loop>
<sourceid="video-src" src="img/video.mp4"type="video/mp4">
</video>
Solution 3:
I having a method to make video autoplay without muting on Chrome. This method has two steps. Step one:Extracting audio for video file using javascript(Extracting audio from a video file); Step two:use AudioContext Api play the audio(it's extract for video file),and play the video on muted;
Solution 4:
You should use autoPlay and not autoplay.
use this code:
<videoclass="z-depth-1"autoPlayloopcontrolsmuted><sourcesrc={YOUR_VIDEO_SOURCE}type="video/mp4" /></video>
Post a Comment for "Html5 Video Autoplay Not Working In Chrome"