Class TrackSelectionOverrides.TrackSelectionOverride
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionOverrides.TrackSelectionOverride
-
- All Implemented Interfaces:
Bundleable
- Enclosing class:
- TrackSelectionOverrides
public static final class TrackSelectionOverrides.TrackSelectionOverride extends Object implements Bundleable
Forces the selection oftrackIndexesfor aTrackGroup.If multiple {link #tracks} are overridden, as many as possible will be selected depending on the player capabilities.
If a
TrackSelectionOverrides.TrackSelectionOverridehas no tracks (tracks.isEmpty()), no tracks will be played. This is similar toTrackSelectionParameters.disabledTrackTypes, except it will only affect the playback of the associatedTrackGroup. For example, if the onlyC.TRACK_TYPE_VIDEOTrackGroupis associated with no tracks, no video will play until the next video starts.
-
-
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<TrackSelectionOverrides.TrackSelectionOverride>CREATORObject that can restoreTrackSelectionOverridefrom aBundle.TrackGrouptrackGroupTheTrackGroupwhosetrackIndexesare forced to be selected.ImmutableList<Integer>trackIndexesThe index of tracks in aTrackGroupto be selected.
-
Constructor Summary
Constructors Constructor Description TrackSelectionOverride(TrackGroup trackGroup)Constructs an instance to force all tracks intrackGroupto be selected.TrackSelectionOverride(TrackGroup trackGroup, List<Integer> trackIndexes)Constructs an instance to forcetrackIndexesintrackGroupto be selected.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)inthashCode()BundletoBundle()Returns aBundlerepresenting the information stored in this object.
-
-
-
Field Detail
-
trackGroup
public final TrackGroup trackGroup
TheTrackGroupwhosetrackIndexesare forced to be selected.
-
trackIndexes
public final ImmutableList<Integer> trackIndexes
The index of tracks in aTrackGroupto be selected.
-
CREATOR
public static final Bundleable.Creator<TrackSelectionOverrides.TrackSelectionOverride> CREATOR
Object that can restoreTrackSelectionOverridefrom aBundle.
-
-
Constructor Detail
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup trackGroup)
Constructs an instance to force all tracks intrackGroupto be selected.
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup trackGroup, List<Integer> trackIndexes)
Constructs an instance to forcetrackIndexesintrackGroupto be selected.- Parameters:
trackGroup- TheTrackGroupfor which to override the track selection.trackIndexes- The indexes of the tracks in theTrackGroupto select.
-
-
Method Detail
-
toBundle
public Bundle toBundle()
Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-