YouTip LogoYouTip

Prop Video Texttracks

HTML DOM Video textTracks Property

HTML DOM Video textTracks Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

HTML DOM Track Object

HTML DOM Video startDate Property

Video textTracks Property

Video Object Reference Video Object

Example

Get the number of available text tracks:

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

Try it yourself Β»


Definition and Usage

The textTracks property returns a TextTrackList object.

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

Each available text track is represented by a TextTrack object.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The textTracks property is supported in Internet Explorer, Opera, Chrome, and Safari 6.

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


Syntax

videoObject.textTracks

Return Value

Type Description
TextTrackList Object Represents the available text tracks of an audio/video.
TextTrackList Object Properties:
* length - Gets the number of available text tracks in the audio/video
* - Gets a TextTrack object by index
Note: The index of the first available text track is 0.
TextTrack Object Represents a text track.
TextTrack Object Properties:
* kind - Gets the kind of the text track (can be "subtitles", "captions", "descriptions", "chapters", or "metadata")
* label - Gets the label of the text track
* language - Gets the language of the text track
* mode - Gets or sets whether the track is active ("disabled"|"hidden"|"showing")
* cues - Gets a TextTrackCueList object of the cues
* activeCues - Gets a TextTrackCueList object of the currently active text track cues
* addCue(cue) - Adds a cue to the cues list
* removeCue(cue) - Removes a cue from the cues list

Video Object Reference Video Object

HTML DOM Track Object

HTML DOM Video startDate Property

← Prop Video VideotracksProp Video Startdate β†’