HTML5视频无法播放 [英] HTML5 video not playing

查看:187
本文介绍了HTML5视频无法播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为HTML5尝试了一个简单的示例,但它似乎无法正常工作。

I tried a simple example for HTML5 but it doesnt seem to work.

<!DOCTYPE html>
<html>
<body>

<video width="320" height="240" controls="controls">
  <source src="resources/sample/sample1.m4v" type="video/mp4" />
</video>

</body>
</html>

我在chrome上尝试了这个例子,视频加载了,但它没有播放,我可以看到视频帧,如果我来回移动滑块,但视频本身不播放。

I tried the example on chrome, the video loads up, but it does not play, i can see the video frames if i move the slider to and fro but the video itself doesnot play.

更新:
我在localhost(tomcat)上访问它,它仍然以同样的方式作出反应。
另外我注意到我无法在chrome或firefox上播放任何HTML5视频(更新)。

UPDATE: I accessed this on localhost(tomcat), its still reacting in the same way. Also i noticed that i am not able to play any HTML5 videos on chrome or firefox(updated).

推荐答案

添加控件作为标志。它允许浏览器在视频上运行自己的播放器代码。我在Chrome上使用.mp4文件尝试过此功能。

Add "controls" as a flag. It allows the browser to run it's own player code on the video. I tried this with a .mp4 file on Chrome and it works.

这篇关于HTML5视频无法播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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