I\'m trying to add a video to my homepage in replace of a slider.
I understand how and why mobile devices disable autoplay.
However FacebookHome and Youtub
Autoplay on most mobile platforms (Android, iOS) gets blocked to avoid poor user experiences - video should only play following a user action. You can usually work around it by triggering the play() on another event (eg the onloaded event)
Facebook Home provides a video type extension .ogv
which worked on FireFox Beta only (I tried both Google chrome And Android default browser, but it just shows the poster image)
<video poster="Poster.jpg" autoplay="1" loop="1">
<source src="myVideo.mp4">
<source src="myVideo.ogv">
</video>
Demo
Another solution is to add event listener
to trigger the video to be played when the user clicks on the video element
<video id="myVideo" poster="Poster.jpg">
<source src="myVideo.mp4">
<source src="myVideo.ogv">
</video>
JS:
var video = document.getElementById('myVideo');
video.addEventListener('click',function(){
video.play();
},false);
Demo Works with Firefox beta (Inside windows) But for in Android Browser it calls Video Player App to play the video
Resources: