I created a simple HTML page with multiple video tag & trying to play all video simultaneously on native WebView
of Android 4.2.2. However it is working on Chrome browser of Android 4.2.2. also tried to chrome-webview
bundle from GitHub in my application to use android-chrome WebView
class object instead of native webkit-engine/webview
. It display player on HTML page but any of video doesn't get played.
I do not understand why this is happen because i have even tried chrome-webview
code and get same result, please suggest me some solution or alternative for same.
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++) {
// TODO: use attachEvent in IE
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>