Class TrackSelectionOverride
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionOverride
-
- All Implemented Interfaces:
Bundleable
@Deprecated public final class TrackSelectionOverride extends Object implements Bundleable
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 aTrackGroup
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 aTrackSelectionParameters
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 aTrackSelectionParameters
is similar todisabling a track type
, except that an empty override will only be applied if the media being played contains aTrackGroup
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 restoreTrackSelectionOverride
from aBundle
.TrackGroup
mediaTrackGroup
Deprecated.The mediaTrackGroup
whosetrackIndices
are forced to be selected.ImmutableList<Integer>
trackIndices
Deprecated.The indices of tracks in aTrackGroup
to be selected.
-
Constructor Summary
Constructors Constructor Description TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)
Deprecated.Constructs an instance to forcetrackIndex
intrackGroup
to be selected.TrackSelectionOverride(TrackGroup mediaTrackGroup, List<Integer> trackIndices)
Deprecated.Constructs an instance to forcetrackIndices
intrackGroup
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 theC.TrackType
of the overridden track group.int
hashCode()
Deprecated.Bundle
toBundle()
Deprecated.Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
mediaTrackGroup
public final TrackGroup mediaTrackGroup
Deprecated.The mediaTrackGroup
whosetrackIndices
are forced to be selected.
-
trackIndices
public final ImmutableList<Integer> trackIndices
Deprecated.The indices of tracks in aTrackGroup
to be selected.
-
CREATOR
public static final Bundleable.Creator<TrackSelectionOverride> CREATOR
Deprecated.Object that can restoreTrackSelectionOverride
from aBundle
.
-
-
Constructor Detail
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)
Deprecated.Constructs an instance to forcetrackIndex
intrackGroup
to be selected.- Parameters:
mediaTrackGroup
- The mediaTrackGroup
for which to override the track selection.trackIndex
- The index of the track in theTrackGroup
to select.
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup mediaTrackGroup, List<Integer> trackIndices)
Deprecated.Constructs an instance to forcetrackIndices
intrackGroup
to be selected.- Parameters:
mediaTrackGroup
- The mediaTrackGroup
for which to override the track selection.trackIndices
- The indices of the tracks in theTrackGroup
to select.
-
-
Method Detail
-
getType
public @com.google.android.exoplayer2.C.TrackType int getType()
Deprecated.Returns theC.TrackType
of the overridden track group.
-
toBundle
public Bundle toBundle()
Deprecated.Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-