Html-track-tag
提供:Dev Guides
HTML-<track>タグ
説明
HTML <track>タグは、<audio>および<video>タグのキャプション、字幕、およびその他のコンテンツを定義するために使用されます
例
<!Doctype html>
<html>
<head>
<title>HTML source Tag</title>
</head>
<body>
<audio controls>
<source src = "yourfile.mp3">
<track src = "subtitles.vtt" kind = "subtitles" srclang = "en" label =" English">
<p>:The browser doesnot support the file</p>
</audio>
</body>
</html>
これは、次の結果を生成します-
グローバル属性
このタグは、− link:/html/html_attributes_reference [HTML属性リファレンス]で説明されているすべてのグローバル属性をサポートします
特定の属性
HTML <track>タグは、次の追加属性もサポートしています-
Attribute | Value | Description |
---|---|---|
default HTML-5 | default | uses the default track |
kind HTML-5 |
captions 章 説明 メタデータ 字幕 |
kind of track to be used |
label HTML-5 | text | displays title of text track |
src HTML-5 | URL | URL of track file |
srclang class = "inline" HTML-5 | language_code | specifies language of the text |
イベント属性
このタグは、− link:/html/html_events_reference [HTMLイベントリファレンス]で説明されているすべてのイベント属性をサポートします。
ブラウザのサポート
Chrome | Firefox | IE | Opera | Safari | Android |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |