Package com.castlabs.android.player
Interface TrackSelectionListener
public interface TrackSelectionListener
This is a high level listener interface that provides callbacks for track selection events.
*NOTE* that all listener methods are invoked on the UI/main thread of your applications.
You can directly interact with UI components from within the implementation of you listener.
- Since:
- 4.2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidonAudioTrackChanged(AudioTrack audioTrack) Called when the selected audio track changes.voidonSubtitleTrackChanged(SubtitleTrack subtitleTrack) Called when the selected subtitle track changes.voidonVideoQualitySelectionChanged(VideoTrackQuality videoTrackQuality, int reason, String switchDescription, long bufferedDurationUs, long bitrateEstimate) Called each time when starting to load a new media chunk.voidonVideoTrackChanged(VideoTrack videoTrack) Called when the selected video track changes.
-
Method Details
-
onVideoQualitySelectionChanged
void onVideoQualitySelectionChanged(@NonNull VideoTrackQuality videoTrackQuality, int reason, @Nullable String switchDescription, long bufferedDurationUs, long bitrateEstimate) Called each time when starting to load a new media chunk. *NOTE* This is not when the actual quality starts playing, but rather when the ABR algorithm selects it. If you want to know when the player changes the (rendering) video quality useFormatChangeListener.onVideoFormatChange(Format, int, long, VideoTrackQuality)instead.- Parameters:
videoTrackQuality- The selected qualityreason- The selection reason. One of theC.SELECTION_REASON_*andSdkConsts.SELECTION_REASON_*constantsswitchDescription- Optional switch descriptionbufferedDurationUs- The buffer ahead in microseconds at the time of the selectionbitrateEstimate- The bandwidth estimation in bps at the time of the selection
-
onVideoTrackChanged
Called when the selected video track changes.- Parameters:
videoTrack-VideoTrackornullif video is disabled
-
onAudioTrackChanged
Called when the selected audio track changes.- Parameters:
audioTrack-AudioTrackornullif audio is disabled
-
onSubtitleTrackChanged
Called when the selected subtitle track changes.- Parameters:
subtitleTrack-SubtitleTrackornullif subtitle is disabled
-