html5视频标签不工作在android phonegap [英] html5 video tag not working in android phonegap

查看:137
本文介绍了html5视频标签不工作在android phonegap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在android phonegap创建应用程序。我想使用html5视频播放器播放视频。我的代码是:

I have created application in android phonegap.I want to play video using html5 video player. My code is:

<!DOCTYPE html>
<html>
    <head>
      <title>Video.js | HTML5 Video Player</title>
      <link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet" type="text/css"> 
      <script src="http://vjs.zencdn.net/c/video.js"></script>
    </head>
    <body>
      <video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" data-setup='{"controls":true}'>
        <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
        <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
        <source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
      </video>
    </body>
</html> 

这段代码显示视频播放器,但点击播放按钮时视频没有播放。
请指导我。提前感谢。

This code show the videoplayer .but video is not playing while clicking play button.what's wrong? please guide me. thanks in advance.

推荐答案

你说它没有在模拟器上工作,对吗?你不认为视频没有被重现主要是因为在Android SDK模拟器你可能没有任何硬件加速吗?如果你没有硬件加速和足够强大的设备,有些东西不能正常工作(有时不工作)。

You said it didn't worked on emulator, right? Don't you think video isn't being reproduced mainly because on Android SDK emulator you probably don't have any hardware acceleration for it? Some things don't work properly (sometimes don't work at all) if you don't have HW acceleration and a device powerful enough for that.

如果这是case,解决方法是使用3GP格式的视频。这应该工作Android SDK模拟器,和老的Android手机手机弱硬件。我用于我的一个项目。

If that's the case, a workaround is using videos in 3GP format. That should work Android SDK emulator, and on older Android-powered cellphones with weak hardware. I used that on a project of mine.

这篇关于html5视频标签不工作在android phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆