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 TypeMethodDescriptionvoid
onAudioTrackChanged
(AudioTrack audioTrack) Called when the selected audio track changes.void
onSubtitleTrackChanged
(SubtitleTrack subtitleTrack) Called when the selected subtitle track changes.void
onVideoQualitySelectionChanged
(VideoTrackQuality videoTrackQuality, int reason, String switchDescription, long bufferedDurationUs, long bitrateEstimate) Called each time when starting to load a new media chunk.void
onVideoTrackChanged
(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
-VideoTrack
ornull
if video is disabled
-
onAudioTrackChanged
Called when the selected audio track changes.- Parameters:
audioTrack
-AudioTrack
ornull
if audio is disabled
-
onSubtitleTrackChanged
Called when the selected subtitle track changes.- Parameters:
subtitleTrack
-SubtitleTrack
ornull
if subtitle is disabled
-