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 aTrackGroupand 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
TrackGroupequal to the one in the override. If aTrackSelectionParameterscontains 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
trackIndicesis empty then the override specifies that no tracks should be selected. Adding an empty override to aTrackSelectionParametersis similar todisabling a track type, except that an empty override will only be applied if the media being played contains aTrackGroupequal 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>CREATORDeprecated.Object that can restoreTrackSelectionOverridefrom aBundle.TrackGroupmediaTrackGroupDeprecated.The mediaTrackGroupwhosetrackIndicesare forced to be selected.ImmutableList<Integer>trackIndicesDeprecated.The indices of tracks in aTrackGroupto be selected.
-
Constructor Summary
Constructors Constructor Description TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)Deprecated.Constructs an instance to forcetrackIndexintrackGroupto be selected.TrackSelectionOverride(TrackGroup mediaTrackGroup, List<Integer> trackIndices)Deprecated.Constructs an instance to forcetrackIndicesintrackGroupto be selected.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Deprecated.@com.google.android.exoplayer2.C.TrackType intgetType()Deprecated.Returns theC.TrackTypeof the overridden track group.inthashCode()Deprecated.BundletoBundle()Deprecated.Returns aBundlerepresenting the information stored in this object.
-
-
-
Field Detail
-
mediaTrackGroup
public final TrackGroup mediaTrackGroup
Deprecated.The mediaTrackGroupwhosetrackIndicesare forced to be selected.
-
trackIndices
public final ImmutableList<Integer> trackIndices
Deprecated.The indices of tracks in aTrackGroupto be selected.
-
CREATOR
public static final Bundleable.Creator<TrackSelectionOverride> CREATOR
Deprecated.Object that can restoreTrackSelectionOverridefrom aBundle.
-
-
Constructor Detail
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)
Deprecated.Constructs an instance to forcetrackIndexintrackGroupto be selected.- Parameters:
mediaTrackGroup- The mediaTrackGroupfor which to override the track selection.trackIndex- The index of the track in theTrackGroupto select.
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup mediaTrackGroup, List<Integer> trackIndices)
Deprecated.Constructs an instance to forcetrackIndicesintrackGroupto be selected.- Parameters:
mediaTrackGroup- The mediaTrackGroupfor which to override the track selection.trackIndices- The indices of the tracks in theTrackGroupto select.
-
-
Method Detail
-
getType
public @com.google.android.exoplayer2.C.TrackType int getType()
Deprecated.Returns theC.TrackTypeof the overridden track group.
-
toBundle
public Bundle toBundle()
Deprecated.Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-