0

I am developing an html5 player supports ads with video-js

Since i know it doesn't work in iOS, is it the same on Android?

So far i've tried these with no luck on autoplay in Android

HTML

  <video id="inReadPlayer" autoplay loop="loop" 
    controls preload="auto" class="video-js vjs-default-skin" width="640"
height="360" > <source src="'+videoSource+'" type="video/mp4">
  </video>

JS

 var player = videojs('inReadPlayer', { /* Options */ }, function() {
            this.play();
            this.on('ended', function() {

            });
 });

Thanks in advance

Özgür Ersil
  • 6,909
  • 3
  • 19
  • 29
  • it's like in iOS, so it won't work look also [here](http://stackoverflow.com/questions/9075520/how-to-autoplay-html5-mp4-video-on-android) – user1555320 Aug 18 '16 at 08:07

1 Answers1

0

Try this:

var videoplayer = document.getElementById('inReadPlayer')
videoplayer.addEventListener("load", function() {
videoplayer.play();
});
videoplayer.onended = function() {
source.setAttribute('src', 'MAINVIDEO.mp4');

};
  <video id="inReadPlayer" autoplay loop="loop" 
    controls preload="auto" class="video-js vjs-default-skin" width="640"
height="360" > <source src="'+videoSource+'" type="video/mp4">
  </video>

Note that this snippet won't work because there is no video source