HTML5 视频格式 - 兼容性

标签 html video mp4 ogg webm

因此,我正在构建一个网站,用户可以在该网站上上传观看视频。 我正在使用标准的 HTML5 视频播放器 ( <video...> <src>... ) 目前,我使用多个来源:MP4、OGG 和 WEBM,以实现跨浏览器兼容性

由于维护三种格式既是 CPU 密集型(转换)又占用宝贵的磁盘空间,我开始搜索是否真的需要支持这三种格式

根据我在维基百科 (http://en.wikipedia.org/wiki/HTML5_video) 上找到的图表, OGG 和 MP4 应该足够了,因为所有浏览器似乎都至少支持其中一种格式

... 还是我遗漏了什么?

最佳答案

要获得全面的答案,请参阅:http://diveintohtml5.info/video.html底部有一个开始过时的兼容性矩阵,但在撰写本文时是权威的。

  • Firefox 3.5+ supports Theora video and Vorbis audio in an Ogg container. Firefox 4+ also supports WebM.
  • Opera 10.5+ supports Theora video and Vorbis audio in an Ogg container. Opera 10.60 (and later) also supports WebM.
  • Chrome 3.0+ supports H.264, Theora video and Vorbis audio in an Ogg container. Chrome 6.0+ also supports WebM.
  • Safari on Macs and Windows PCs 3.0+ will support anything that QuickTime supports. In theory, you could require your users to install third-party QuickTime plugins. In practice, few users are going to do that. So you’re left with the formats that QuickTime supports “out of the box.” This is a long list, but it does not include WebM, Theora, Vorbis, or the Ogg container. However, QuickTime does ship with support for H.264 video (main profile) and AAC audio in an MP4 container.
  • Mobile phones like Apple’s iPhone and Google Android phones support H.264 video (baseline profile) and AAC audio (“low complexity” profile) in an MP4 container.
  • Adobe Flash (9.0.60.184 and later) supports H.264 video (all profiles) and AAC audio (all profiles) in an MP4 container.
  • Internet Explorer 9+ supports all profiles of H.264 video and either AAC or MP3 audio in an MP4 container. It will also play WebM video if you install a third-party codec, which is not installed by default on any version of Windows. IE does not support other third-party codecs (unlike Safari, which will play anything QuickTime can play).
  • Internet Explorer 8 has no HTML5 video support at all, but virtually all Internet Explorer users will have the Adobe Flash plugin. Later in this chapter, I’ll show you how you can use HTML5 video but gracefully fall back to Flash.

关于HTML5 视频格式 - 兼容性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14636415/

相关文章:

html - 如何使用 CSS 右对齐表格的最后两列

html - 检测将在 Ruby on Rails 中呈现为空的字符串

javascript - 网络 ERP 系统。打印系统发票,无需编辑、下载

audio - 从Hi8-Lp格式转换视频

Android:无法播放mp4视频

html - Firefox 8 支持 mp4 吗?

html - 对齐 Logo 、标题和菜单

html - 带有视频背景的页眉,位置在 safari 中不起作用

video - ffserver配置文件: RTSPOption

video - 将 mp3 转换为 mp4