如何在 HTML5 中添加媒体播放器使用的文本轨道?
htmlweb developmentfront end technology更新于 2025/8/14 10:20:17
使用 HTML5 中的 <track> 标签可以添加媒体播放器使用的文本轨道。您可以尝试运行以下代码来了解如何在 HTML5 中添加媒体播放器使用的文本轨道。 −
示例
<!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 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

