如果您為視頻提供兩個字幕軌道,請使用默認屬性來標識要啟用的軌道。
示例
您可以嘗試以下代碼來實現軌道的默認屬性 –
<!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中?的詳細內容,更多請關注www.92cms.cn其它相關文章!