VideoTrack
interface represents a single video track from a <video>
element. The most common use for accessing a VideoTrack
object is to toggle its selected
property in order to make it the active video track for its <video>
element.A string
which uniquely identifies the track within the media. This ID can be used to locate a specific track within a video track list by calling VideoTrackList.getTrackById()
. The ID can also be used as the fragment part of the URL if the media supports seeking by media fragment per the Media Fragments URI specification.
Promise<string>
A string
specifying the category into which the track falls. For example, the main video track would have a kind
of "main"
.
Promise<string>
A string
providing a human-readable label for the track. For example, a track whose kind
is "sign"
might have a label
of "A sign-language interpretation"
. This string is empty if no label is provided.
Promise<string>
A string
specifying the video track's primary language, or an empty string if unknown. The language is specified as a BCP 47 (RFC 5646) language code, such as "en-US"
or "pt-BR"
.
Promise<string>
A Boolean value which controls whether or not the video track is active. Only a single video track can be active at any given time, so setting this property to true
for one track while another track is active will make that other track inactive.
Promise<boolean>