HTML Audio/Video DOMtextTracksProperty
HTML Audio/Video DOM Reference
Examples
Get the number of available text tracks:
myVid=document.getElementById("video1");
alert(myVid.textTracks.length);
alert(myVid.textTracks.length);
Try it Yourself »
Definition and Usage
The textTracks property returns a TextTrackList object.
The TextTrackList object represents the available text tracks of 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
audio|video.textTracks
Return Value
| Type | Description |
|---|---|
| TextTrackList object | Represents the available text tracks of the audio/video. TextTrackList object:
Note:The index of the first available text trackindexis 0. |
| TextTrack object | Represents a text track. Properties of the TextTrack object:
|
HTML Audio/Video DOM Reference Other Extensions