Skip to main content

TrackManager

Extends

  • default

Methods

getVideoTracks()

getVideoTracks(): VideoTrack[]

Returns the video tracks.

Returns

VideoTrack[]


getAudioTracks()

getAudioTracks(): AudioTrack[]

Returns the audio tracks.

Returns

AudioTrack[]


getTextTracks()

getTextTracks(): TextTrack[]

Returns the text tracks including side-loaded tracks.

Returns

TextTrack[]


getVideoTrack()

getVideoTrack(): null | VideoTrack

Returns the active video track.

Returns

null | VideoTrack


getVideoRendition()

getVideoRendition(): null | VideoRendition

Returns the active video rendition. If adaptive video is enabled, returns null.

Returns

null | VideoRendition


getAdaptiveVideoEnabled()

getAdaptiveVideoEnabled(): boolean

Returns whether adaptive video is enabled.

Returns

boolean


getAudioTrack()

getAudioTrack(): null | AudioTrack

Returns the active audio track.

Returns

null | AudioTrack


getTextTrack()

getTextTrack(): null | TextTrack

Returns the active text track.

Returns

null | TextTrack


setVideoTrack()

setVideoTrack(track): Promise<void>

Switches to the given the video track.

Parameters

ParameterTypeDescription
trackVideoTrackThe video track to switch to.

Returns

Promise<void>


setVideoRendition()

setVideoRendition(rendition): Promise<void>

Switches to the given the video track. As a consequence, adaptive video will be disabled.

Parameters

ParameterTypeDescription
renditionVideoRenditionThe video rendition to switch to.

Returns

Promise<void>


enableAdaptiveVideo()

enableAdaptiveVideo(): Promise<void>

Enforces adaptive video playback.

Returns

Promise<void>


setAudioTrack()

setAudioTrack(track): Promise<void>

Switches to the given audio track.

Parameters

ParameterTypeDescription
trackAudioTrackThe audio track to switch to.

Returns

Promise<void>


setTextTrack()

setTextTrack(track): Promise<void>

Selects the text track. If the track is null, the text overlay will be hidden.

Parameters

ParameterTypeDescription
tracknull | TextTrackThe text track to switch to, or null to hide text overlay

Returns

Promise<void>


setVideoFilterConfiguration()

setVideoFilterConfiguration(videoFilterConfiguration): Promise<void>

Note: This API is only supported on Android. On other platforms, the method safely performs no action.

Applies a video filter configuration to the current player instance.

This method allows defining constraints that influence how the player selects video tracks (e.g., limiting resolution, bitrate, or frame rate). The configuration is forwarded to the native Android player module.

When the configuration is successfully applied, the player emits a EventType.TrackModelChanged event, signalling that the active or selectable video tracks may have been updated.

Parameters

ParameterTypeDescription
videoFilterConfigurationVideoFilterConfigurationA set of video selection constraints. See VideoFilterConfiguration for full parameter details. If an empty object is provided, the player applies no filtering constraints.

Returns

Promise<void>

A promise that resolves once the configuration has been applied on the native layer.

Example

await player.getTrackManager().setVideoFilterConfiguration({
maxBitrate: 2_000_000,
maxFramerate: 30,
maxHeight: 720,
});