我正在将html5媒体播放器集成到我的应用程序中。我使用下面的代码将媒体播放器嵌入我的webview
<!DOCTYPE HTML>
<html>
<body>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
我只能获得声音,但不会显示视频。任何人都可以指导我如何嵌入html5的媒体播放器。
答案 0 :(得分:0)
您need手动调用play
方法:
var videoNode = document.getElementsByTagName('video')[0];
videoNode.addEventListener('click',function(){
this.play();
},false);