AwaitedDOM/ VideoTrackList

The VideoTrackList interface is used to represent a list of the video tracks contained within a <video> element, with each track represented by a separate VideoTrack object in the list.
Retrieve an instance of this object with HTMLMediaElement.videoTracks. The individual tracks can be accessed using array syntax or functions such as forEach() for example.

Properties

.length
W3C

The number of tracks in the list.

Type: Promise<number>

.selectedIndex
W3C

The index of the currently selected track, if any, or −1 otherwise.

Type: Promise<number>

Methods

.getTrackById(id)
W3C

Returns the VideoTrack found within the VideoTrackList whose id matches the specified string. If no match is found, null is returned.

Arguments:

  • id string. A string indicating the ID of the track to locate within the track list.

Returns: VideoTrack

Unimplemented Specs

Properties

onaddtrackonchange
onremovetrack

Methods

addEventListener()dispatchEvent()
removeEventListener()

Edit this page on GitHub