import VideoTrack from '../models/VideoTrack'; import AudioTrack from '../models/AudioTrack'; import VideoRendition from '../models/VideoRendition'; import TextTrack from '../models/TextTrack'; import PlayerExtension from './PlayerExtension'; import Event from '../events/Event'; import VideoFilterConfiguration from '../models/VideoFilterConfiguration'; /** @group Classes */ export default class TrackManager extends PlayerExtension { private readonly trackModel; /** @hidden */ onNativeEvent(event: Event): void; private onTrackModelChanged; /** * Returns the video tracks. */ getVideoTracks(): VideoTrack[]; /** * Returns the audio tracks. */ getAudioTracks(): AudioTrack[]; /** * Returns the text tracks including side-loaded tracks. */ getTextTracks(): TextTrack[]; /** * Returns the active video track. */ getVideoTrack(): VideoTrack | null; /** * Returns the active video rendition. * If adaptive video is enabled, returns null. */ getVideoRendition(): VideoRendition | null; /** * Returns whether adaptive video is enabled. */ getAdaptiveVideoEnabled(): boolean; /** * Returns the active audio track. */ getAudioTrack(): AudioTrack | null; /** * Returns the active text track. */ getTextTrack(): TextTrack | null; /** * Switches to the given the video track. * @param track - The video track to switch to. */ setVideoTrack(track: VideoTrack): Promise; /** * Switches to the given the video track. * As a consequence, adaptive video will be disabled. * @param rendition - The video rendition to switch to. */ setVideoRendition(rendition: VideoRendition): Promise; /** * Enforces adaptive video playback. */ enableAdaptiveVideo(): Promise; /** * Switches to the given audio track. * @param track - The audio track to switch to. */ setAudioTrack(track: AudioTrack): Promise; /** * Selects the text track. * If the track is null, the text overlay will be hidden. * * @param track - The text track to switch to, or null to hide text overlay */ setTextTrack(track: TextTrack | null): Promise; /** * **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 * {@link EventType.TrackModelChanged} event, signalling that the active or * selectable video tracks may have been updated. * * @param videoFilterConfiguration - A set of video selection constraints. * See {@link VideoFilterConfiguration} for full parameter details. * If an empty object is provided, the player applies no filtering constraints. * * @returns A promise that resolves once the configuration has been applied on * the native layer. * * @example * ```tsx * await player.getTrackManager().setVideoFilterConfiguration({ * maxBitrate: 2_000_000, * maxFramerate: 30, * maxHeight: 720, * }); * ``` */ setVideoFilterConfiguration(videoFilterConfiguration: VideoFilterConfiguration): Promise; private get nativePlayerModule(); }