Easy Tutorial
❮ Prop Password Maxlength Jsref Obj Array ❯

Video textTracks Property

Video Object

Example

Get the number of available text tracks:

var x = document.getElementById("myVideo").textTracks.length;

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, Opera, Chrome, and Safari 6 support the textTracks property.

Note: Firefox and 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. Properties of the TextTrackList object: length - Get the number of available text tracks in the audio/video. [index] - Get the TextTrack object by index. Note: The index of the first available text track is 0.
TextTrack object Represents a single text track. Properties of the TextTrack object: kind - Get the type of the text track (can be "subtitles", "captions", "descriptions", "chapters", or "metadata"). label - Get the label of the text track. language - Get the language of the text track. mode - Get or set whether the track is active ("disabled" "hidden" "showing"). cues - Get the TextTrackCueList object's cues list. activeCues - Get the current active text track cues in the form of a TextTrackCueList object. addCue(cue) - Add a cue to the cues list. removeCue(cue) - Remove a cue from the cues list.

❮ Prop Password Maxlength Jsref Obj Array ❯