热门问题
时间线
聊天
视角
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