Easy Tutorial
❮ Att A Shape Att Option Label ❯

HTML Audio/Video DOM textTracks Property

HTML Audio/Video DOM Reference Manual

Example

Get the number of available text tracks:


Definition and Usage

The textTracks property returns a TextTrackList object.

The TextTrackList object represents the available text tracks for the audio/video.

Each available text track is represented by a TextTrack object.


Browser Support

Internet Explorer 10, Opera, Chrome, and Safari 6 support the textTracks property.

Note: Internet Explorer 9 and earlier versions do not support the textTracks property.


Syntax

Return Value

Type Description
TextTrackList Object Represents the available text tracks for the audio/video. TextTrackList Object: length - Get the number of available text tracks in the audio/video<br> [index] - Get the TextTrack object based on the index. Note: The index of the first available text track is 0.
TextTrack Object Represents a text track. TextTrack Object properties: kind - Get the type of the text track (can be "subtitles", "captions", "descriptions", "chapters", or "metadata")<br> label - Get the label of the text track<br> language - Get the language of the text track<br> mode - Get or set whether the track is active ("disabled" "hidden" "showing")<br> cues - Get the cues list as a TextTrackCueList object<br> activeCues - Get the current active text track cues as a TextTrackCueList object<br> addCue(cue) - Add a cue to the cues list<br> removeCue(cue) - Remove a cue from the cues list

❮ Att A Shape Att Option Label ❯