Interface: VideoTrackList
A collection of video tracks with selection support. May be empty or only synthetic when native track info is unavailable.
Note: Video tracks are available after the integration.ready promise resolves.
The list is iterable and can be converted to an array:
Example
for (const track of integration.videoTracks) { console.log(track); }
const tracks = Array.from(integration.videoTracks);Extends
EventTarget.Iterable<VideoTrack>
Properties
length
readonlylength:number
The number of tracks in the list.
selected
readonlyselected:VideoTrack|null
The currently selected video track, or null if unavailable.
Methods
addEventListener()
addEventListener(
type,listener,options?):void
Adds an event listener for track list changes.
Parameters
type
The event type: 'trackschange' (track list changed) or 'change' (selection changed).
"change" | "trackschange"
listener
EventListener
The callback function.
options?
Optional event listener options.
boolean | AddEventListenerOptions
Returns
void
Overrides
EventTarget.addEventListener
getTrackById()
getTrackById(
id):VideoTrack|null
Returns the track with the specified ID.
Parameters
id
string
The track ID to search for.
Returns
VideoTrack | null
The matching track, or null if not found.
select()
select(
trackOrId):void
Selects a video track or enables automatic quality selection.
Parameters
trackOrId
The track, track ID, or 'auto' for ABR.
string | VideoTrack
Returns
void