HTML-5:视频标签。视频未播放
我正在尝试使用/测试 HTML-5 的视频标签。下面的代码
<!DOCTYPE HTML>
<html>
<body>
<video src="./Pilot.avi" controls="controls">
your browser does not support the video tag
</video>
</body>
</html>
Pilot.avi 存储在与此 HTML 页面相同的目录中。
问题是,我看到正在显示控件,但无法播放视频。
我尝试过,
1) Mozilla Firefox 3.6.13
2) Google Chrome 8.0.552.224
可能是什么问题?
问候, 微内核
I was trying use/test video tag of HTML-5. Here is the code
<!DOCTYPE HTML>
<html>
<body>
<video src="./Pilot.avi" controls="controls">
your browser does not support the video tag
</video>
</body>
</html>
Pilot.avi is stored in the same same directory as this HTML page.
The problem is, I am seeing the controls being displayed but can't play the video.
I tried with,
1) Mozilla Firefox 3.6.13
2) Google Chrome 8.0.552.224
What could be the problem?
Regards,
Microkernel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试不同的视频格式。检查此以供参考。
Try a different video format. Check this for reference.
最可能的原因是浏览器不支持视频格式。我认为任何东西都支持 AVI 容器,那是在我们讨论有关编解码器的问题之前。
The most likely cause is that the video format isn't supported by the browsers. I think think anything supports AVI containers, and that is before we get into questions about codecs.
HTML5 视频不支持 .avi 容器。您可以使用其他格式,我推荐 VP8 编解码器(或 WebP):由 Google 开发,似乎是未来的网络视频格式。 在这里您可以找到有关它的更多信息以及这里有一个可用于将视频转换为这种格式的工具列表。
此致,坦克雷迪。
.avi container is not supported for HTML5 videos. You'd use other formats, I reccomend VP8 codec (or WebP): is developed by Google and seems to be the future web video format. Here you can find more info about it and here there is a list of tools you can use to convert your videos in this format.
Yours sincerely, Tancredi.
如果该文件位于您的本地文件系统上,某些浏览器可能会导致问题。
我正在实现类似的东西,但使用 Firefox,我无法使用 HTML5 视频标签访问本地文件夹中的视频文件。
但 Chrome 对我来说就像一个魅力。
If the file is on your local file system, some browsers may cause a problem.
I was implementing something similar and with Firefox, I couldn't access a video file on my local folder with HTML5 video tag.
But Chrome worked like a charm in my case.
mp4 编解码器...尽管在许多开源纯粹主义者中存在争议...是最好的解决方案,并且几乎所有浏览器都支持它。此外,它还可以在 Flash 容器内使用,这样您就可以拥有一个 html5 文件和一个 Flash 后备文件。
The mp4 codec...although controversial among many open source purists...is the best solution and it is supported by just about every browser. In addition it can be used inside a flash container so you can have one file for html5 and a flash fallback.
长视频也有可能无法播放。尝试播放时长 15 秒或 20 秒的短视频。它可能会起作用。
Also there is a chance that a long video will not play. Try a short video with a 15s or 20s duration. It might work.