HTMLオーディオ/ビデオDOMaddTextTrack()メソッド

❮HTMLオーディオ/ビデオDOMリファレンス

ビデオに新しいテキストトラックを追加します。

var text1 = myVid.addTextTrack("caption");
text1.addCue(new TextTrackCue("Test text", 01.000, 04.000, "", "", "", true));

定義と使用法

addTextTrack()メソッドは、新しいTextTrackオブジェクトを作成して返します。

新しいTextTrackオブジェクトが、オーディオ/ビデオ要素のテキストトラックのリストに追加されます。


ブラウザのサポート

Method
addTextTrack() Not supported Not supported Not supported Not supported Not supported

構文

audio|video.addTextTrack(kind,label,language)

パラメータ値

Value Description
kind Specifies the kind of text track.

Possible values:

  • "subtitles"
  • "caption"
  • "descriptions"
  • "chapters"
  •  "metadata"
label A string specifying the label for the text track. Is used to identify the text track for the users
language A two-letter language code that specifies the language of the text track.
To view all available language codes, go to our Language code reference

技術的な詳細

戻り値: 新しいテキストトラックを表すTextTrackオブジェクト

❮HTMLオーディオ/ビデオDOMリファレンス