I created a simple HTML page with several video tags and tried to play all the videos at once in my native WebViewAndroid 4.2.2. However, it works with the Chrome browser Android 4.2.2. also tried passing the chrome-webviewpackage from GitHub to my application in order to use the android-chrome class object WebViewinstead of native webkit-engine/webview. It displays the player on an HTML page, but any of the videos does not play.
I don’t understand why this is happening, because I even tried the code chrome-webviewand got the same result, please offer me some solution or alternative for it.
I can share my HTML code
<!DOCTYPE html>
<html>
<head>
<script>
function init() {
enableVideoClicks();
}
function enableVideoClicks() {
var videos = document.getElementsByTagName('video') || [];
for (var i = 0; i < videos.length; i++) {
videos[i].addEventListener('click', function(videoNode) {
return function() {
videoNode.play();
};
}(videos[i]));
}
}
</script>
</head>
<body onload="init()">
<video src="movie1.mp4" poster = "l.jpg" width="400" height="300" autoplay controls loop></video>
<video src="movie2.mp4" poster = "l.jpg" width="400" height="300" autoplay controls loop></video>
<video src="movie3.mp4" poster = "l.jpg" width="400" height="300" autoplay controls loop></video>
...
</body>
</html>