如何在 Android 中通过 PhoneGap 框架使用 Html5 的视频标签
根据:
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var video = document.getElementById('video');
video.addEventListener('click',function(){
video.play();
},false);
</script>
</head>
<body>
<video id="video" autobuffer height="240" width="360">
<source src="BigBuck.m4v">
<source src="BigBuck.webm" type="video/webm">
<source src="BigBuck.theora.ogv" type="video/ogg">
</video>
</body>
</html>
是这样吗,你能给我一个完整的示例吗?
According:
HTML5 <video> element on Android
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript">
var video = document.getElementById('video');
video.addEventListener('click',function(){
video.play();
},false);
</script>
</head>
<body>
<video id="video" autobuffer height="240" width="360">
<source src="BigBuck.m4v">
<source src="BigBuck.webm" type="video/webm">
<source src="BigBuck.theora.ogv" type="video/ogg">
</video>
</body>
</html>
Is this right, Can you give me a full sample?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Android 设备不支持 HTML5 视频标签,因为它在 Android 的 WebView 中不起作用。 的同一应用程序时出现以下错误,并且只能听到声音(视频未显示):
在我的 Android 3.2 平板电脑设备上,视频标签在常规 Chrome 浏览器中运行良好,但当我尝试运行由 PhoneGap封装 可以在这里找到有关此问题的讨论:http://comments.gmane.org/ gmane.comp.handhelds.phonegap/19275
此问题的当前解决方案是使用原生 Android 媒体播放器(通过 VideoView)播放视频。
有几个开源 PhoneGap 插件可以帮助您解决此问题。
如果您需要更多相关信息,请告诉我。
The HTML5 video tag is not supported on Android devices, because it doesn't work in Android's WebView. On my Android 3.2 tablet device, the video tag is working well in a regular Chrome browser, but gives the folowing error when I try to run the same application wrapped by PhoneGap and I can hear only the sound (Video is not diplayed):
You can find a discussion about this problem here: http://comments.gmane.org/gmane.comp.handhelds.phonegap/19275
The current solution for this issue is to play the video using native Android media player (through VideoView).
There are several open source PhoneGap plugins that can help you with this.
Please let me know if you need more information about this.
要检查三件事:
Three things to check: