public final class FixedTrackSelection extends BaseTrackSelection
TrackSelection consisting of a single track.| Modifier and Type | Class and Description |
|---|---|
static class |
FixedTrackSelection.Factory
Factory for
FixedTrackSelection instances. |
group, length, tracks| Constructor and Description |
|---|
FixedTrackSelection(TrackGroup group,
int track) |
FixedTrackSelection(TrackGroup group,
int track,
int reason,
java.lang.Object data) |
| Modifier and Type | Method and Description |
|---|---|
int |
getSelectedIndex()
Returns the index of the selected track.
|
java.lang.Object |
getSelectionData()
Returns optional data associated with the current track selection.
|
int |
getSelectionReason()
Returns the reason for the current track selection.
|
void |
updateSelectedTrack(long playbackPositionUs,
long bufferedDurationUs,
long availableDurationUs)
Updates the selected track.
|
blacklist, disable, enable, equals, evaluateQueueSize, getFormat, getIndexInTrackGroup, getSelectedFormat, getSelectedIndexInTrackGroup, getTrackGroup, hashCode, indexOf, indexOf, isBlacklisted, length, onPlaybackSpeedpublic FixedTrackSelection(TrackGroup group, int track)
group - The TrackGroup. Must not be null.track - The index of the selected track within the TrackGroup.public FixedTrackSelection(TrackGroup group, int track, int reason, @Nullable java.lang.Object data)
group - The TrackGroup. Must not be null.track - The index of the selected track within the TrackGroup.reason - A reason for the track selection.data - Optional data associated with the track selection.public void updateSelectedTrack(long playbackPositionUs,
long bufferedDurationUs,
long availableDurationUs)
TrackSelectionThis method may only be called when the selection is enabled.
playbackPositionUs - The current playback position in microseconds. If playback of the
period to which this track selection belongs has not yet started, the value will be the
starting position in the period minus the duration of any media in previous periods still
to be played.bufferedDurationUs - The duration of media currently buffered from the current playback
position, in microseconds. Note that the next load position can be calculated as
(playbackPositionUs + bufferedDurationUs).availableDurationUs - The duration of media available for buffering from the current
playback position, in microseconds, or C.TIME_UNSET if media can be buffered
to the end of the current period. Note that if not set to C.TIME_UNSET, the
position up to which media is available for buffering can be calculated as
(playbackPositionUs + availableDurationUs).public int getSelectedIndex()
TrackSelectionpublic int getSelectionReason()
TrackSelection@Nullable public java.lang.Object getSelectionData()
TrackSelection