排版引擎比较 (HTML5媒体)
外观
	
	
| HTML | 
|---|
| 比较 | 
HTML5规范定义了几个标签,允许在语义上原生包含视频和音频。下表比较了排版引擎之间对这一规范各个方面的支持。
表格说明
[编辑]引擎命名
[编辑]這裡使用後端的引擎名而不是瀏覽器的名稱。使用各瀏覽器引擎的瀏覽器如下表所示。
- ^ chromium / chromium/blink. chromium.googlesource.com. Google. [2014-05-27].
 - ^ 2.0 2.1 在Konqueror中,用户可以切换排版引擎。
 - ^ WebKit Nightly Builds. webkit.org. [2014-05-27].
 
取值
[编辑]以下各格的顏色表示該排版引擎的最新版本或指定版本(如果给出版本号的话)對該功能的支援程度。没有取值的版本號表示该排版引擎首次完全支援該功能。
| 取值 | 含义 | 
|---|---|
| 是 | 表示該排版引擎完全地支援該功能或元素。 | 
| 否 | 表示該功能或元素尚未有支援。 | 
| 部份 | 表示該功能或元素有實作進展,但並不支援所有取值,對於已支援的取值,該實作是正確的。 | 
| 不正確 | 表示該功能或元素有實作進展,但是實作並非在所有情況都是正確無誤的。 | 
| 實驗性質 | 表示該功能或元素有實作進展,但是使用另外的屬性或元素名(瀏覽器前輟)。多半是不完全實作或是有過多的漏洞。 | 
| 抛弃 | 表示该属性/元素不再受到支持。 | 
| 每日构建 | 表示該功能或元素在未釋出的版本有某種程度的支援。預期將有完整支援。 | 
| 依情況 | 表示该属性/元素仅在某些平台支持或设定在某些配置后支持。 | 
元素属性
[编辑]媒体元素允许在标签中直接设置某些属性
| Trident | Gecko | WebKit | Presto | |
|---|---|---|---|---|
<audio>属性
 | ||||
src
 | 
5.0[t 1] | 1.9.1 | 525 | 2.5 | 
preload
 | 
2.0[note 1][g 1] | 實驗性質[note 1] | ||
autoplay
 | 
1.9.1 | 2.5 | ||
loop
 | 
11.0[g 2] | |||
controls
 | 
1.9.1 | |||
<video>属性
 | ||||
src
 | 
5.0[t 1] | 1.9.1 | 525 | 2.5 | 
preload
 | 
2.0[note 1][g 1] | 實驗性質[note 1] | ||
autoplay
 | 
1.9.1 | 2.5 | ||
loop
 | 
11.0[g 2] | |||
controls
 | 
1.9.1 | |||
poster
 | 
1.9.2[g 3] | |||
width
 | 
1.9.1 | |||
height
 | ||||
<source>属性
 | ||||
src
 | 
5.0[t 1] | 1.9.1 | 525[w 1] | 2.5 | 
type
 | ||||
media
 | 
15.0[g 4] | |||
<track>属性
 | ||||
kind
 | 
6.0[t 2] | 24.0[g 5] | 是[w 2] | 否 | 
label
 | ||||
src
 | ||||
srclang
 | ||||
DOM属性
[编辑]与媒体元素有关的一些属性包含在DOM中。
| Trident | Gecko | WebKit | Presto[p 1] | |
|---|---|---|---|---|
| 错误状态 | ||||
MediaError
 | 
5.0 [t 3] | 1.9.1 | ? | 2.5 | 
| 网络状态 | ||||
src
 | 
5.0[t 1] | 1.9.1 | ? | 2.5 | 
currentSrc
 | ||||
networkState
 | ||||
preload
 | 
2.0[note 1][g 1] | 否 | ||
buffered
 | 
2.0[g 6] | |||
load()
 | 
1.9.1 | 2.5 | ||
canPlayType()
 | 
533[w 3] | |||
| 就绪状态 | ||||
readyState
 | 
5.0[t 1] | 1.9.1 | ? | 2.5 | 
seeking
 | ||||
| 回放状态 | ||||
currentTime
 | 
5.0[t 1] | 1.9.1 | ? | 2.5 | 
startTime
 | 
否 | |||
duration
 | 
1.9.1 | |||
paused
 | ||||
defaultPlaybackRate
 | 
20.0[g 7] | 否 | ||
playbackRate
 | ||||
played
 | 
15.0[g 8] | |||
seekable
 | 
8.0[g 9] | |||
ended
 | 
1.9.1 | 2.5 | ||
autoplay
 | ||||
loop
 | 
11.0[g 2] | |||
play()
 | 
1.9.1 | |||
pause()
 | ||||
| 控制 | ||||
controls
 | 
5.0[t 1] | 1.9.1 | ? | 2.5 | 
volume
 | ||||
muted
 | ||||
DOM事件
[编辑]媒体元素引入新的事件处理仅适用于那些元素的情况,如暂停/恢复。
| Trident | Gecko[g 10] | WebKit | Presto | |
|---|---|---|---|---|
loadstart
 | 
5.0[t 4] | 1.9.1 | ? | ? | 
progress
 | ||||
suspend
 | 
1.9.2 | |||
abort
 | 
1.9.1 | |||
error
 | ||||
emptied
 | ||||
stalled
 | 
8.0[g 11] | |||
play
 | 
1.9.1 | |||
pause
 | ||||
loadedmetadata
 | ||||
loadeddata
 | ||||
waiting
 | ||||
playing
 | 
否 | |||
canplay
 | 
1.9.1 | |||
canplaythrough
 | ||||
seeking
 | ||||
seeked
 | ||||
timeupdate
 | ||||
ended
 | ||||
ratechange
 | ||||
durationchange
 | ||||
volumechange
 | 
视频格式支持
[编辑]| Trident | Gecko | WebKit | Presto | |
|---|---|---|---|---|
| Ogg Theora | 手动安装[note 2] | 1.9.1[g 12] | 依情況[note 3] | 2.5 | 
| H.264 | 5.0[t 6] | 33.0[8][g 13] | 依赖(525)[note 3][w 9] | 依情況[note 4] | 
| WebM VP8 | 手动安装[note 2] | 2.0[g 14][g 15] | 依赖(534)[w 10] | 2.6.30[p 3][p 4][p 5] | 
音频格式支持
[编辑]| Trident | Gecko | WebKit | Presto | |
|---|---|---|---|---|
| Ogg Vorbis | 手动安装[note 2] | 1.9.1[g 12] | 依情況[note 3] | 2.5 | 
| WAV PCM | 525[note 3] | 2.0 | ||
| MP3 | 5.0[t 7] | 否[g 16] | 依情況[note 4] | |
| AAC | 否 | |||
| Speex | 手动安装[note 2] | 否[g 17] | 依情況[note 3] | 否 | 
| Opus | IE 12 ?? [g 18] | 15.0[g 19] | 依情況[note 3] | 否 | 
注释
[编辑]- ^ 1.0 1.1 1.2 1.3 1.4 
preload以旧名字autobuffer支持。 - ^ 2.0 2.1 2.2 2.3 Google为多媒体应用库发布了一个WebM组件以允许WebM文件在IE9中通过标准HTML5<video>标签播放[t 5]。Xiph.org分发了OpenCodecs包,其修正了Google的基于DirectShow的VP8解码器。VLC多媒体播放器附带有“网页插件”,从而使VLC从
<video>与<audio>标签中播放多媒体,让其支持所有VLC支持的格式。 - ^ 3.0 3.1 3.2 3.3 3.4 3.5 在Mac OS X下WebKit支持QuickTime[w 4],默认情况下,其支持H.264、MP3、AAC和WAV PCM格式,如果安装了XiphQT等第三方编解码器则会额外支持Ogg Theora与Vorbis格式。Google Chrome支持Theora、Vorbis、WebM与MP3格式[w 5]。Chromium可以被编译以支持任意FFmpeg支持的格式,并可以选择是否支持诸如H.264和MP3的专利格式[w 6]。MorphOS上的Origyn网页浏览器也采用FFmpeg播放HTML5媒体内容。[w 7][w 8]
 - ^ 4.0 4.1 在Linux与FreeBSD上,Presto 2.5使用GStreamer库的系统版本,并且可以播放任何GStreamer支持的格式(包括H.264、MP3、AAC等, 前提是已安装解码器) 。在其他平台上,它只支持Ogg Theora格式的视频和Ogg Vorbis与WAVE PCM的音频。[p 2]
 
参考
[编辑]- ^ Amaya Binary Releases, Most recent download link in stable
 - ^ Change log between EdgeHTML 12.10240 and 13.10586
 - ^ Firefox 77.0.1, See All New Features, Updates and Fixes. mozilla.org. Mozilla基金會. 2020-06-03.
 - ^ Firefox ESR 68.9.0, See All New Features, Updates and Fixes. mozilla.org. Mozilla基金會. 2020-06-02.
 - ^ Index of /pub/firefox/releases/145.0b9/. 2025年10月31日 [2025年11月3日] (英語).
 - ^ Firefox Nightly 146.0a1, See All New Features, Updates and Fixes [date mislabeled as "October 13, 2025"]. 2025年10月14日 [2025年10月14日] (英語).
 - ^ Download for kdelibs, Most recent download link in stable
 - ^ via OpenH264
 
Trident参考
[编辑]- ^ 1.0 1.1 1.2 1.3 1.4 1.5 1.6 Internet Explorer Platform Preview Guide for Developers, Microsoft, [2016-02-06], (原始内容存档于2014-03-12)
 - ^ track element - track object (Internet Explorer). Microsoft. [12 July 2013]. (原始内容存档于2013-07-15).
 - ^ MSDN HTMLMediaError Object for Internet Explorer 9, Microsoft, [2016-02-06], (原始内容存档于2017-05-28)
 - ^ video object. Microsoft. [12 July 2013]. (原始内容存档于2016-03-14).
 - ^ Jazayeri, Mike, More about the Chrome HTML Video Codec Change, Google, 2011-01-14 [2016-02-06], (原始内容存档于2012-10-03)
 - ^ McCracken, Harry, Microsoft Previews the Revamped Internet Explorer 9 Platform, Technologizer, 2010-03-16 [2016-02-06], (原始内容存档于2021-02-28)
 - ^ Branscombe, Mary, Microsoft previews Internet Explorer 9, TechRadar UK, 2010-03-16, (原始内容存档于2010-03-22)
 
Gecko参考
[编辑]- ^ 1.0 1.1 1.2 Bug 548523 - HTML 5 media attribute 'autobuffer' has been renamed to 'preload', Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ 2.0 2.1 2.2 Bug 449157 - Implement the looping attributes in media elements, Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bug 449156 - Implement the poster attribute for the <video> element, Mozilla, [2016-02-06], (原始内容存档于2021-01-24)
 - ^ Bug 449363 - Support media attribute of <source> elements, Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bug 629350 - Implement the track element, Mozilla, [2016-02-06], (原始内容存档于2019-04-02)
 - ^ Bug 462957 - Implement nsIDOMHTMLMediaElement::GetBuffered(), Mozilla, [2016-02-06], (原始内容存档于2021-03-07)
 - ^ Bug 495040 - Implement playbackRate, Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bug 462959 - Implement nsIDOMHTMLMediaElement::GetPlayed(), Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bug 462960 - Implement nsIDOMHTMLMediaElement::GetSeekable(), Mozilla, [2016-02-06], (原始内容存档于2021-03-07)
 - ^ Using audio and video in Firefox - Media events, Mozilla, [2016-02-06], (原始内容存档于2012-05-08)
 - ^ Bug 481082 - Video controls should listen for |stalled| event, Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ 12.0 12.1 Shepherd, Eric, Media formats supported by the audio and video elements, Mozilla, 2010-01-28 [2009-10-11], (原始内容存档于2012年5月4日)
 - ^ Bug 799318 - [meta] Support H.264/AAC/MP3 video/audio playback on desktop Firefox, Mozilla, [2016-02-06], (原始内容存档于2021-02-24)
 - ^ Bug 566243 - Merge mozilla-webmedia repository to mozilla-central, Mozilla, [2016-02-06], (原始内容存档于2021-02-24)
 - ^ Firefox WebM Builds, Mozilla, [2016-02-06], (原始内容存档于2010-06-08)
 - ^ Bug 562730 - Reproducing Mp3 files with html5, Mozilla, [2016-02-06], (原始内容存档于2021-03-07)
 - ^ Bug 476752 - support the speex voice codec in <audio> and <video> elements, Mozilla, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bringing Interoperable Real-Time Communications to the Web, Skype, [2016-02-06], (原始内容存档于2016-08-09)
 - ^ Bug 674225 - support the Opus voice codec in <audio> and <video> elements, Mozilla, [2016-02-06], (原始内容存档于2020-11-11)
 
WebKit参考
[编辑]- ^ Pfeiffer, Silvia, [whatwg] Quality Values for Media Source Elements, 2009-12-13, (原始内容存档于2011-07-19)
 - ^ April 2012 HTML5 Media Element & WebAudio – WebKit, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Bug 24364 - Add HTMLMediaElement canPlayType method, WebKit, [2016-02-06], (原始内容存档于2021-03-08)
 - ^ Koivisto, Antti, HTML5 Media Support, WebKit, 2007-11-12 [2016-02-06], (原始内容存档于2021-09-04)
 - ^ Look for "GOOGLE_CHROME_BUILD", [2016-02-06], (原始内容存档于2021-02-25)
 - ^ DiBona, Chris, [whatwg] Google's use of FFmpeg in Chromium and Chrome Was: Re: MPEG-1 subset proposal for HTML5 video codec, Google, 2009-06-01, (原始内容存档于2011-07-19)
 - ^ Origyn Web Browser for MorphOS, Fabian Coeurjoly, [2010-01-04], (原始内容存档于2010-03-17)
 - ^ Holwerda, Thom, Origyn Web Browser 1.7 Supports HTML5 Media, More, OSNews, 2010-03-08 [2010-03-08], (原始内容存档于2010-03-12)
 - ^ HTML Video Codec Support in Chrome, [2010-01-22], (原始内容存档于2011-06-21)
 - ^ Bankoski, Jim, WebM and VP8 land in Chromium, Google, 2010-05-19 [2016-02-06], (原始内容存档于2010-05-21)
 
Presto参考
[编辑]- ^ Pieters, Simon, Everything you need to know about HTML5 video and audio, Opera, 2010-03-10 [2016-02-06], (原始内容存档于2014-03-29)
 - ^ Jägenstedt, Philip, (re-)Introducing <video>, Opera, 2009-12-31, (原始内容存档于2010-01-04)
 - ^ Lie, Håkon Wium, Welcome, WebM <video>!, Opera, 2010-05-19, (原始内容存档于2011-03-21)
 - ^ Mills, Chris, Opera supports the WebM video format, Opera, 2010-05-19 [2016-02-06], (原始内容存档于2011-04-05)
 - ^ Kleinhout, Huib, Opera 10.60 goes final, Opera, 2010-07-01, (原始内容存档于2010-07-02)