Back to Exoplayer

TrackSelectionOverride (ExoPlayer library)

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

latest8.6 KB
Original Source

Package com.google.android.exoplayer2.trackselection

Class TrackSelectionOverride

  • java.lang.Object

    • com.google.android.exoplayer2.trackselection.TrackSelectionOverride
  • All Implemented Interfaces:Bundleable


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classTrackSelectionOverrideextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](../Bundleable.html "interface in com.google.android.exoplayer2")

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 override, consisting of a TrackGroup and the indices of the tracks within the group that should be selected.

A track selection override is applied during playback if the media being played contains a TrackGroup equal to the one in the override. If a TrackSelectionParameters contains only one override of a given track type that applies to the media, this override will be used to control the track selection for that type. If multiple overrides of a given track type apply then the player will apply only one of them.

If trackIndices is empty then the override specifies that no tracks should be selected. Adding an empty override to a TrackSelectionParameters is similar to disabling a track type, except that an empty override will only be applied if the media being played contains a TrackGroup equal to the one in the override. Conversely, disabling a track type will prevent selection of tracks of that type for all media.

Nested Class Summary

- 

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

Bundleable.Creator<T extends Bundleable>

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static Bundleable.Creator<TrackSelectionOverride> | CREATOR | Deprecated.

Object that can restore TrackSelectionOverride from a Bundle. | | TrackGroup | mediaTrackGroup | Deprecated.

The media TrackGroup whose trackIndices are forced to be selected. | | ImmutableList<Integer> | trackIndices | Deprecated.

The indices of tracks in a TrackGroup to be selected. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | TrackSelectionOverride​(TrackGroup mediaTrackGroup, int trackIndex) | Deprecated.

Constructs an instance to force trackIndex in trackGroup to be selected. | | TrackSelectionOverride​(TrackGroup mediaTrackGroup, List<Integer> trackIndices) | Deprecated.

Constructs an instance to force trackIndices in trackGroup to be selected. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | boolean | equals​(Object obj) | Deprecated. | | @com.google.android.exoplayer2.C.TrackType int | getType() | Deprecated.

Returns the C.TrackType of the overridden track group. | | int | hashCode() | Deprecated. | | Bundle | toBundle() | Deprecated.

Returns a Bundle representing the information stored in this object. |

- 

Methods inherited from class java.lang.Object

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

Field Detail

- 

mediaTrackGroup

public final[TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")mediaTrackGroup

Deprecated.

The media TrackGroup whose trackIndices are forced to be selected.

- 

trackIndices

public final[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[Integer](https://developer.android.com/reference/java/lang/Integer.html "class or interface in java.lang")> trackIndices

Deprecated.

The indices of tracks in a TrackGroup to be selected.

- 

CREATOR

public static final[Bundleable.Creator](../Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[TrackSelectionOverride](TrackSelectionOverride.html "class in com.google.android.exoplayer2.trackselection")> CREATOR

Deprecated.

Object that can restore TrackSelectionOverride from a Bundle.

Constructor Detail

- 

TrackSelectionOverride

public TrackSelectionOverride​([TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")mediaTrackGroup,
                              int trackIndex)

Deprecated.

Constructs an instance to force trackIndex in trackGroup to be selected. Parameters:mediaTrackGroup - The media TrackGroup for which to override the track selection.trackIndex - The index of the track in the TrackGroup to select.

- 

TrackSelectionOverride

public TrackSelectionOverride​([TrackGroup](../source/TrackGroup.html "class in com.google.android.exoplayer2.source")mediaTrackGroup,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Integer](https://developer.android.com/reference/java/lang/Integer.html?is-external=true "class or interface in java.lang")> trackIndices)

Deprecated.

Constructs an instance to force trackIndices in trackGroup to be selected. Parameters:mediaTrackGroup - The media TrackGroup for which to override the track selection.trackIndices - The indices of the tracks in the TrackGroup to select.

Method Detail

- 

getType

public @com.google.android.exoplayer2.C.TrackType int getType()

Deprecated.

Returns the C.TrackType of the overridden track group.

- 

equals

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

Deprecated. Overrides:equals in class Object

- 

hashCode

public int hashCode()

Deprecated. Overrides:hashCode in class Object

- 

toBundle

public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()

Deprecated.

Description copied from interface: Bundleable

Returns a Bundle representing the information stored in this object. Specified by:toBundle in interface Bundleable