HTML Audio/Video DOM addTextTrack() Method
Example
var vid = document.getElementById("demo");
function myFunction() {
var txt = vid.addTextTrack("caption");
txt.addCue(new TextTrackCue("Demo text", 01.000, 05.000, "", "", "", true));
}
Meaning
The addTextTrack() method creates and returns a new TextTrack object. The new TextTrack object is added to the list of text tracks for the audio/video element.
Standard Syntax
audio|video.addTextTrack(kind,label,language)
Advertisement
Parameter Value
| Type | Description |
|---|---|
| kind | Specifies the kind of text track.
Possible values:
|
| label | Specifying the label for the text track. |
| language | Specifies two-letter language code of the text track. |