HTML5视频格式-兼容性 [英] HTML5 video formats - compatibility

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

问题描述

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

So, I'm building a website on which users can upload an watch videos. I'm using the standard HTML5 video player (<video...> <src>...) Currently, I use multiple sources: MP4, OGG and WEBM, for cross-browser compatibility

由于维护三种格式既要占用大量CPU(转换),又要消耗宝贵的磁盘空间,因此我开始寻找是否需要真正支持这三种格式

Due to the fact that maintaining three formats is both CPU intensive (converting) as well as eating away precious disk space, I started searching the need to find out whether it's really needed to support this three formats

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

According to the chart I found on Wikipedia (http://en.wikipedia.org/wiki/HTML5_video), OGG and MP4 should be sufficient, as all browsers seem to be supporting at least one of these formats

...还是我错过了什么?

... or am I missing something?

推荐答案

有关完整的答案,请参见: http://diveintohtml5.info/video.html 底部有一个兼容性矩阵,该矩阵开始已过时,但在撰写本文时是权威的.

For a comprehensive answer see: http://diveintohtml5.info/video.html There's a compatibility matrix toward the bottom that is beginning to be outdated, but was authoritative at the time the article was written.

  • Firefox 3.5+在Ogg容器中支持Theora视频和Vorbis音频. Firefox 4+还支持WebM.
  • Opera 10.5+在Ogg容器中支持Theora视频和Vorbis音频. Opera 10.60(及更高版本)也支持WebM.
  • Chrome 3.0+在Ogg容器中支持H.264,Theora视频和Vorbis音频. Chrome 6.0+还支持WebM.
  • Mac和Windows PC 3.0+上的
  • Safari将支持QuickTime支持的任何功能.从理论上讲,您可能需要用户安装第三方QuickTime插件.实际上,很少有用户会这样做.因此,您将获得QuickTime支持的开箱即用"格式.这是一长串,但不包括WebM,Theora,Vorbis或Ogg容器.但是,QuickTime确实支持MP4容器中的H.264视频(主配置文件)和AAC音频.
  • Apple iPhone和Google Android手机之类的手机在MP4容器中支持H.264视频(基线配置文件)和AAC音频(低复杂度"配置文件).
  • Adob​​e Flash(9.0.60.184及更高版本)在MP4容器中支持H.264视频(所有配置文件)和AAC音频(所有配置文件).
  • Internet Explorer 9+支持MP4容器中的H.264视频和AAC或MP3音频的所有配置文件.如果您安装了第三方编解码器(默认情况下未在任何版本的Windows上安装),它还将播放WebM视频. IE不支持其他第三方编解码器(与Safari不同,Safari可以播放QuickTime可以播放的任何内容).
  • Internet Explorer 8完全不支持HTML5视频,但实际上所有Internet Explorer用户都将具有Adobe Flash插件.在本章的后面,我将向您展示如何使用HTML5视频,但又可以轻松地使用Flash.
  • 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视频格式-兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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