Interface: AudioTrackList
A collection of audio tracks with selection support. A selected track is available when track info is exposed; otherwise null.
Note: Audio 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.audioTracks) { console.log(track); }
const tracks = Array.from(integration.audioTracks);Extends
MediaTrackList<AudioTrack>
Properties
length
readonlylength:number
The number of tracks in the list.
Inherited from
MediaTrackList.length
selected
readonlyselected:AudioTrack|null
The currently selected audio 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
Inherited from
MediaTrackList.addEventListener
getTrackById()
getTrackById(
id):AudioTrack|null
Returns the track with the specified ID.
Parameters
id
string
The track ID to search for.
Returns
AudioTrack | null
The matching track, or null if not found.
Inherited from
MediaTrackList.getTrackById
select()
select(
trackOrId):void
Selects an audio track.
Parameters
trackOrId
The track or track ID to select.
string | AudioTrack
Returns
void