HTML Audio/Video DOM textTracks Property
❮ HTML Audio/Video DOM Reference
Example
Get the number of available text tracks:
let vid = document.getElementById("myVideo");
alert(vid.textTracks.length);
Try it Yourself »
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 an TextTrack Object.
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
textTracks | Yes | 10.0 | 33.0 | 6.0 | Yes |
Syntax
audio|video.textTracks
Return Value
Type | Description |
---|---|
TextTrackList Object | Represents the available text tracks for the the audio/video. TextioTrackList Object:
Note: The first available TextTrack object is index 0 |
TextTrack Object | Represents an text track. TextTrack Object Properties:
|
❮ HTML Audio/Video DOM Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.