HTML5
我想知道 HTML5 标签现在是否支持播放 .avi 格式的视频文件。
I am wondering if the HTML5 <video>
tag now supports playback of .avi format video files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
简短的回答:不。请使用 WebM 或 Ogg。
本文涵盖了您需要了解的有关
的所有内容元素,包括哪些浏览器支持哪些容器格式和编解码器。
Short answer: No. Use WebM or Ogg instead.
This article covers just about everything you need to know about the
<video>
element, including which browsers support which container formats and codecs.三种格式具有合理的支持水平:H.264 (MPEG-4 AVC)、OGG Theora (VP3) 和 WebM (VP8)。请参阅 Sam 链接的 wiki,了解哪些浏览器支持哪些浏览器;您通常至少需要其中之一以及 Flash 后备。
虽然大多数浏览器不会接触 AVI,但有些浏览器版本将底层操作系统的所有多媒体功能公开给
。这些浏览器确实能够播放 AVI,只要安装了匹配的编解码器(AVI 可以包含大约一百万种不同的视频和音频格式)。特别是 OS X 上带有 QuickTime 的 Safari 或带有 GStreamer 的 Konqi。
就我个人而言,我认为这绝对是一个灾难性的想法,因为它向网络暴露了非常大的编解码器代码库,而该代码库大多不是为了抵御网络攻击而编写的。媒体播放器插件最严重的缺点之一是它们为每个网页漏洞提供了大量的安全漏洞。我们不要再犯这样的错误了。
There are three formats with a reasonable level of support: H.264 (MPEG-4 AVC), OGG Theora (VP3) and WebM (VP8). See the wiki linked by Sam for which browsers support which; you will typically need at least one of those plus Flash fallback.
Whilst most browsers won't touch AVI, there are some browser builds that expose all the multimedia capabilities of the underlying OS to
<video>
. These browser will indeed be able to play AVI, as long as they have matching codecs installed (AVI can contain about a million different video and audio formats). In particular Safari on OS X with QuickTime, or Konqi with GStreamer.Personally I think this is an absolutely disastrous idea, as it exposes a very large codec codebase to the net, a codebase that was mostly not written to be resistant to network attacks. One of the worst drawbacks of media player plugins was the huge number of security holes they made available to every web page exploit. Let's not make this mistake again.
当前的 HTML5 草案规范并未指定浏览器在 video 标签中应支持哪些视频格式。用户代理可以自由支持他们认为合适的任何视频格式。
http://en.wikipedia.org/wiki/HTML5_video
The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate.
http://en.wikipedia.org/wiki/HTML5_video
HTML 规范从不指定任何内容格式。那不是它的工作。有很多标准组织比 W3C 更有资格指定视频格式。
这就是内容协商的目的。
元素指定任何图像格式。
元素指定任何样式表语言。元素指定任何脚本语言。
元素指定任何音频格式。
为什么要为
元素指定一个?
The HTML specification never specifies any content formats. That's not its job. There's plenty of standards organizations that are more qualified than the W3C to specify video formats.
That's what content negotiation is for.
<img>
element.<style>
element.<script>
element.<object>
andembed
elements.<audio>
element.Why should it specify one for the
<video>
element?