TextTrackCue.id
id
は TextTrackCue
インターフェイスのプロパティで、このキューの識別子を返したり設定したりします。
値
このキューの ID を持つ文字列です。
例
以下の例では、新しい VTTCue
(TextTrackCue
を継承したもの)が作成されます。そして、キューを追加する前に、 id
プロパティを "first" に設定しています。
let video = document.querySelector('video');
let track = video.addTextTrack("captions", "Captions", "en");
track.mode = "showing";
let cue1 = new VTTCue(0, 0.9, 'Hildy!');
cue1.id = "first";
track.addCue(cue1);
仕様書
Specification |
---|
HTML Standard # dom-texttrackcue-id |
ブラウザーの互換性
BCD tables only load in the browser