docs/doc/reference/com/google/android/exoplayer2/trackselection/TrackSelection.html
Package com.google.android.exoplayer2.trackselection
ExoTrackSelectionAll Known Implementing Classes:AdaptiveTrackSelection, BaseTrackSelection, FakeTrackSelection, FixedTrackSelection, RandomTrackSelection[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceTrackSelection
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 track selection consisting of a static subset of selected tracks belonging to a TrackGroup.
Tracks belonging to the subset are exposed in decreasing bandwidth order.
Nested Classes | Modifier and Type | Interface | Description |
| --- | --- | --- |
| static interface | TrackSelection.Type |
Deprecated.
Represents a type track selection. |
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static int | TYPE_CUSTOM_BASE |
Deprecated.
The first value that can be used for application specific track selection types.
|
| static int | TYPE_UNSET |
Deprecated.
An unspecified track selection type. |
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| Format | getFormat(int index) |
Deprecated.
Returns the format of the track at a given index in the selection.
|
| int | getIndexInTrackGroup(int index) |
Deprecated.
Returns the index in the track group of the track at a given index in the selection.
|
| TrackGroup | getTrackGroup() |
Deprecated.
Returns the TrackGroup to which the selected tracks belong.
|
| @com.google.android.exoplayer2.trackselection.TrackSelection.Type int | getType() |
Deprecated.
Returns an integer specifying the type of the selection, or TYPE_UNSET if not specified.
|
| int | indexOf(int indexInTrackGroup) |
Deprecated.
Returns the index in the selection of the track with the specified index in the track group.
|
| int | indexOf(Format format) |
Deprecated.
Returns the index in the selection of the track with the specified format.
|
| int | length() |
Deprecated.
Returns the number of tracks in the selection. |
-
static final int TYPE_UNSET
Deprecated.
An unspecified track selection type. See Also:Constant Field Values
-
static final int TYPE_CUSTOM_BASE
Deprecated.
The first value that can be used for application specific track selection types. See Also:Constant Field Values
-
@com.google.android.exoplayer2.trackselection.TrackSelection.Type int getType()
Deprecated.
Returns an integer specifying the type of the selection, or TYPE_UNSET if not specified.
Track selection types are specific to individual applications, but should be defined starting from TYPE_CUSTOM_BASE to ensure they don't conflict with any types that may be added to the library in the future.
-
[TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")getTrackGroup()
Deprecated.
Returns the TrackGroup to which the selected tracks belong.
-
int length()
Deprecated.
Returns the number of tracks in the selection.
-
[Format](../Format.html "class in com.google.android.exoplayer2")getFormat(int index)
Deprecated.
Returns the format of the track at a given index in the selection.
Parameters:index - The index in the selection.Returns:The format of the selected track.
-
int getIndexInTrackGroup(int index)
Deprecated.
Returns the index in the track group of the track at a given index in the selection.
Parameters:index - The index in the selection.Returns:The index of the selected track.
-
int indexOf([Format](../Format.html "class in com.google.android.exoplayer2")format)
Deprecated.
Returns the index in the selection of the track with the specified format. The format is located by identity so, for example, selection.indexOf(selection.getFormat(index)) == index even if multiple selected tracks have formats that contain the same values.
Parameters:format - The format.Returns:The index in the selection, or C.INDEX_UNSET if the track with the specified format is not part of the selection.
-
int indexOf(int indexInTrackGroup)
Deprecated.
Returns the index in the selection of the track with the specified index in the track group.
Parameters:indexInTrackGroup - The index in the track group.Returns:The index in the selection, or C.INDEX_UNSET if the track with the specified index is not part of the selection.