HTML <track> label 屬性
實(shí)例
帶有兩個(gè)字幕軌道的 video 元素:
<video width="320" height="240" controls>
? <source src="/upload/help/forrest_gump.mp4" type="video/mp4">
? <source src="/upload/help/forrest_gump.ogg" type="video/ogg">
? <track src="/upload/help/subtitles_en.vtt" kind="subtitles" srclang="en"
? label="English">
? <track src="/upload/help/subtitles_no.vtt" kind="subtitles" srclang="no"
? label="Norwegian">
</video>
? <source src="/upload/help/forrest_gump.mp4" type="video/mp4">
? <source src="/upload/help/forrest_gump.ogg" type="video/ogg">
? <track src="/upload/help/subtitles_en.vtt" kind="subtitles" srclang="en"
? label="English">
? <track src="/upload/help/subtitles_no.vtt" kind="subtitles" srclang="no"
? label="Norwegian">
</video>
瀏覽器支持
Internet Explorer 10, Opera, 和 Chrome 支持 label 屬性。
定義和用法
label 屬性規(guī)定了文本軌跡的標(biāo)題。
例如,當(dāng)用戶選擇字幕軌道時(shí),標(biāo)題會顯示出來。
HTML 4.01 與 HTML5之間的差異
<track> 標(biāo)簽是 HTML5 新標(biāo)簽。
語法
<track src="/upload/help/subtitles_en.vtt" kind="subtitles" srclang="en" label="English">
屬性值
值 | 描述 |
---|---|
label | 規(guī)定軌道的標(biāo)題。 |
