HTML5<视频>在Android元素不玩 [英] HTML5 <video> element on Android does not play

查看:160
本文介绍了HTML5<视频>在Android元素不玩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

视频标签中包含正常播放与iPhone,而不是Android的:

Video tags like below plays fine with iPhone, but not Android:

<video id="video" width="320" height="240" poster="video/placeholder.jpg" autobuffer controls>
  <source src="pr6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  <source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>

通过上面的code,机器人甚至不能点击的片段。这将只是看到海报图像。

With the above code, Android can't even click the clip. It would just see the poster image.

如下面视频标签与Android然而作品:

Video tag like below however works with Android:

<video src="vpr6.mp4" poster="video/placeholder.jpg" onclick="this.play();"/>

不过,我仍然需要多个来源的能力(对Firefox的支持OGV ...)。下面code不工作(他们也没有工作,如果我坚持的JavaScript到源代码):

However, I still need to multiple sources capability (for Firefox ogv support…). Below code does not work (nor do they work if I stick the javascript into the source tags):

<video id="video" width="320" height="240" autobuffer controls onclick="this.play();">
  <source src="pr6.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
  <source src="pr6.ogv" type='video/ogg; codecs="theora, vorbis"'>
</video>

使用上述code,剪辑是可以点击的机器人,但仍然什么都不做。

With above code, the clip is clickable in Android, but still does nothing.

谁能帮助?

推荐答案

尝试从源列表中删除codeCS。它可能是,codeCS你上市不是present在Android上,所以它的窒息。

Try to remove the codecs from the source listings.. It might be that the codecs you're listing are not present on Android, so it's choking.

如果您使用src属性,它会自动检测codeC,所以它使用别的东西:)

If you use the src attribute, it'll auto-detect the codec, so it's using something else :)

这篇关于HTML5&LT;视频&GT;在Android元素不玩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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