使用 HTML 中的 kind 屬性來指定 HTML 中文本軌道的類型。例如,您可以將 kind 設(shè)置為字幕文件的字幕。
示例
您可以嘗試運行以下代碼來實現(xiàn) kind 屬性 –
<!DOCTYPE HTML> <html> <body> <video width = "300" height="200" controls autoplay> <source src = "/html5/foo.ogg" type = "video/ogg" /> <source src = "/html5/foo.mp4" type = "video/mp4" /> <track src = "subtitles_en.vtt" kind = "subtitles" srclang = "en" label = "English"> <track src = "subtitles_ru.vtt" kind = "subtitles" srclang = "ru" label = "Russia" default> Your browser does not support the video element. </video> </body> </html>
登錄后復制
以上就是如何在HTML中指定文本軌道的類型?的詳細內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!