热门问题
时间线
聊天
视角
WebVTT
檔案格式 来自维基百科,自由的百科全书
Remove ads
WebVTT(网络视频文字轨,英语:Web Video Text Tracks)是一个用来显示与HTML5<track>
元素相关的timed text的万维网联盟 (W3C)标准。
此规范的早期草稿是由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规范仍处于草稿阶段,但所有主要浏览器都支持基本功能。
Remove ads
与SubRip最大的不同
兼容性
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文件中的字幕会在在线显示,但存储在本机磁盘时并不会显示。
Remove ads
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]
参考资料
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads