Back to Exoplayer

FixedTrackSelection (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/trackselection/FixedTrackSelection.html

latest10.1 KB
Original Source

Package com.google.android.exoplayer2.trackselection

Class FixedTrackSelection


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classFixedTrackSelectionextends[BaseTrackSelection](BaseTrackSelection.html "class in com.google.android.exoplayer2.trackselection")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A TrackSelection consisting of a single track.

Nested Class Summary

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.trackselection.ExoTrackSelection

ExoTrackSelection.Definition, ExoTrackSelection.Factory

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.trackselection.TrackSelection

TrackSelection.Type

Field Summary

- 

Fields inherited from class com.google.android.exoplayer2.trackselection.BaseTrackSelection

group, length, tracks

- 

Fields inherited from interface com.google.android.exoplayer2.trackselection.TrackSelection

TYPE_CUSTOM_BASE, TYPE_UNSET

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | FixedTrackSelection​(TrackGroup group, int track) | Deprecated. | | FixedTrackSelection​(TrackGroup group, int track, @com.google.android.exoplayer2.trackselection.TrackSelection.Type int type) | Deprecated. | | FixedTrackSelection​(TrackGroup group, int track, @com.google.android.exoplayer2.trackselection.TrackSelection.Type int type, @com.google.android.exoplayer2.C.SelectionReason int reason, Object data) | Deprecated. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | int | getSelectedIndex() | Deprecated.

Returns the index of the selected track. | | Object | getSelectionData() | Deprecated.

Returns optional data associated with the current track selection. | | @com.google.android.exoplayer2.C.SelectionReason int | getSelectionReason() | Deprecated.

Returns the reason for the current track selection. | | void | updateSelectedTrack​(long playbackPositionUs, long bufferedDurationUs, long availableDurationUs, List<? extends MediaChunk> queue, MediaChunkIterator[] mediaChunkIterators) | Deprecated.

Updates the selected track for sources that load media in discrete MediaChunks. |

- 

Methods inherited from class com.google.android.exoplayer2.trackselection.BaseTrackSelection

disable, enable, equals, evaluateQueueSize, excludeTrack, getFormat, getIndexInTrackGroup, getSelectedFormat, getSelectedIndexInTrackGroup, getTrackGroup, getType, hashCode, indexOf, indexOf, isTrackExcluded, length, onPlaybackSpeed

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

- 

Methods inherited from interface com.google.android.exoplayer2.trackselection.ExoTrackSelection

getLatestBitrateEstimate, onDiscontinuity, onPlayWhenReadyChanged, onRebuffer, shouldCancelChunkLoad

Constructor Detail

- 

FixedTrackSelection

public FixedTrackSelection​([TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")group,
                           int track)

Deprecated. Parameters:group - The TrackGroup. Must not be null.track - The index of the selected track within the TrackGroup.

- 

FixedTrackSelection

public FixedTrackSelection​([TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")group,
                           int track,
                           @com.google.android.exoplayer2.trackselection.TrackSelection.Type int type)

Deprecated. Parameters:group - The TrackGroup. Must not be null.track - The index of the selected track within the TrackGroup.type - The type that will be returned from TrackSelection.getType().

- 

FixedTrackSelection

public FixedTrackSelection​([TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")group,
                           int track,
                           @com.google.android.exoplayer2.trackselection.TrackSelection.Type int type,
                           @com.google.android.exoplayer2.C.SelectionReason int reason,
                           @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")data)

Deprecated. Parameters:group - The TrackGroup. Must not be null.track - The index of the selected track within the TrackGroup.type - The type that will be returned from TrackSelection.getType().reason - A reason for the track selection.data - Optional data associated with the track selection.

Method Detail

- 

updateSelectedTrack

public void updateSelectedTrack​(long playbackPositionUs,
                                long bufferedDurationUs,
                                long availableDurationUs,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<? extends[MediaChunk](../source/chunk/MediaChunk.html "class in com.google.android.exoplayer2.source.chunk")> queue,[MediaChunkIterator](../source/chunk/MediaChunkIterator.html "interface in com.google.android.exoplayer2.source.chunk")[] mediaChunkIterators)

Deprecated.

Description copied from interface: ExoTrackSelection

Updates the selected track for sources that load media in discrete MediaChunks.

This method will only be called when the selection is enabled.

Parameters: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).queue - The queue of already buffered MediaChunks. Must not be modified.mediaChunkIterators - An array of MediaChunkIterators providing information about the sequence of upcoming media chunks for each track in the selection. All iterators start from the media chunk which will be loaded next if the respective track is selected. Note that this information may not be available for all tracks, and so some iterators may be empty.

- 

getSelectedIndex

public int getSelectedIndex()

Deprecated.

Description copied from interface: ExoTrackSelection

Returns the index of the selected track.

- 

getSelectionReason

public @com.google.android.exoplayer2.C.SelectionReason int getSelectionReason()

Deprecated.

Description copied from interface: ExoTrackSelection

Returns the reason for the current track selection.

- 

getSelectionData

@Nullable
public[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")getSelectionData()

Deprecated.

Description copied from interface: ExoTrackSelection

Returns optional data associated with the current track selection.