2016-08-18 3 views
1

Ich entwickle ein html5-Player Anzeigen video-jsHTML5 Video runter in Android

unterstützt Da ich weiß, dass es nicht in iOS funktioniert, ist es das gleiche auf Android?

Bisher habe ich versucht, diese ohne Glück auf automatische Wiedergabe 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() { 

      }); 
}); 

Vielen Dank im Voraus

+0

es wie in iOS ist, so ist es auch Blick nicht funktionieren [hier] (http://stackoverflow.com/questions/9075520/how-to-autoplay-html5-mp4-video-on-android) – user1555320

Antwort

0

Try th ist:

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>

Beachten Sie, dass dieser Ausschnitt wird nicht funktionieren, weil es keine Video-Quelle ist