WebVTT
WebVTT(网络视频文本轨,英语:)是一个用来显示与HTML5<track>
元素相关的timed text的万维网联盟 (W3C)标准。
.vtt | |
text/vtt | |
开发者 | 万维网联盟 (W3C) |
首次发布 | 2010年8月10日[1] |
最新版本 | 2019年4月4日 |
格式类型 | Timed text |
自 | SRT |
标准 | W3C WebVTT |
自由格式? | 是 |
免费格式? | 是 |
网站 | (VTT) |
此规范的早期草稿是由WHATWG于2010年在讨论HTML5应支持哪种字幕格式后所编写的,主要选项是相对成熟,以XML为基础的定时文本标记语言 (TTML),或是全新但更轻量,以广泛使用的SubRip格式为基础的标准。最后决定使用新的标准,一开始称为WebSRT (Web Subtitle Resource Tracks)。[2]其共享了.srt
扩展名,并扩充了SubRip格式,虽然并不完全兼容。此格式后来更名为WebVTT。[3][4]在2011年1月13日的HTML5草稿报告中,引入了<track>
元素并更新了规范以记录WebVTT字幕文本呈现规则。[5]WebVTT规范仍处于草稿阶段,但所有主要浏览器都支持基本功能。
与SubRip最大的不同
兼容性
浏览器 | 字幕文本标签 | 字幕位置 | CSS样式 |
---|---|---|---|
Chrome | 35+ | ||
Android stock browser | 5.0+ | ||
Opera | 22+ | ||
Safari | 7+ (iOS: 8+) | ||
Firefox | 31+ (Android: 32+) | 不适用 | |
Microsoft Edge | 12+ | 不适用 | |
Internet Explorer | 10+ | 不适用 |
Firefox在Firefox 24的Nightly版本中实作了WebVTT,但一开始并未缺省激活。该功能必须在Firefox的"about:config"页面中通过将"media.webvtt.enabled"值设置为true以激活。[9]YouTube于2013年4月开始支持WebVTT。[10]字2014年7月24日的Firefox 31起,Mozilla已在Firefox上缺省激活WebVTT。[11]
.vtt文件中的字幕会在在线显示,但保存在本机磁盘时并不会显示。
WebVTT格式的范例
WEBVTT
Kind: captions
Language: en
00:09.000 --> 00:11.000
<v Roger Bingham>We are in New York City
00:11.000 --> 00:13.000
<v Roger Bingham>We are in New York City
00:13.000 --> 00:16.000
<v Roger Bingham>We're actually at the Lucern Hotel, just down the street
00:16.000 --> 00:18.000
<v Roger Bingham>from the American Museum of Natural History
00:18.000 --> 00:20.000
<v Roger Bingham>And with me is Neil deGrasse Tyson
00:20.000 --> 00:22.000
<v Roger Bingham>Astrophysicist, Director of the Hayden Planetarium
00:22.000 --> 00:24.000
<v Roger Bingham>at the AMNH.
00:24.000 --> 00:26.000
<v Roger Bingham>Thank you for walking down here.
00:27.000 --> 00:30.000
<v Roger Bingham>And I want to do a follow-up on the last conversation we did.
00:30.000 --> 00:31.500 align:end size:50%
<v Roger Bingham>When we e-mailed—
00:30.500 --> 00:32.500 align:start size:50%
<v Neil deGrasse Tyson>Didn't we talk about enough in that conversation?
00:32.000 --> 00:35.500 align:end size:50%
<v Roger Bingham>No! No no no no; 'cos 'cos obviously 'cos
00:32.500 --> 00:33.500 align:start size:50%
<v Neil deGrasse Tyson><i>Laughs</i>
00:35.500 --> 00:38.000
<v Roger Bingham>You know I'm so excited my glasses are falling off here.
其他功能
2013年6月,规范中添加了一个范例,其中包含了新的「区域」设置。[13]此功能自Firefox 59与Safari 14.1(iOS上则是14.5)开始支持此功能,但其他浏览器均不支持。[14]
参考数据
- . [2015-02-12]. (原始内容存档于2010-08-16).
- . [2015-02-16]. (原始内容存档于2018-10-21).
- Kennedy, Antony; de Leon, Inayaili. . Apress. 2011 [2022-07-17]. ISBN 978-1-4302-3288-9. (原始内容存档于2020-01-26).
- Pfeiffer, Silvia. . 2011-06-27 [2022-07-17]. (原始内容存档于2011-07-06).
- . www.w3.org. [2022-07-24]. (原始内容存档于2022-07-24).
- . W3C. [11 February 2015]. (原始内容存档于2015-10-06).
- . W3C. [2017-02-06]. (原始内容存档于2019-03-06).
- . JWPlayer. [2017-02-06]. (原始内容存档于2016-04-20).
- . bugzilla.mozilla.org. [2022-07-24]. (原始内容存档于2019-04-02) (英语).
- . support.google.com. [2022-07-24]. (原始内容存档于2022-07-24).
- . Mozilla. [2022-07-24]. (原始内容存档于2022-07-24) (英语).
- . w3.org. The World Wide Web Consortium. 2018-05-10 [2018-09-16]. (原始内容存档于2018-05-15) (英语).
- . GitHub. [2022-07-24]. (原始内容存档于2019-12-16) (英语).
- . developer.mozilla.org. [2022-07-24]. (原始内容存档于2022-05-14) (美国英语).
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.