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 oftrackIndicesfor aTrackGroup.If multiple tracks in
trackGroupare overridden, as many as possible will be selected depending on the player capabilities.If
trackIndicesis empty, no tracks fromtrackGroupwill 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.TrackGrouptrackGroupTheTrackGroupwhosetrackIndicesare forced to be selected.ImmutableList<Integer>trackIndicesThe indices 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> trackIndices)Constructs an instance to forcetrackIndicesintrackGroupto be selected.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)@com.google.android.exoplayer2.C.TrackType intgetTrackType()Returns theC.TrackTypeof the overriden track group.inthashCode()BundletoBundle()Returns aBundlerepresenting the information stored in this object.
-
-
-
Field Detail
-
trackGroup
public final TrackGroup trackGroup
TheTrackGroupwhosetrackIndicesare forced to be selected.
-
trackIndices
public final ImmutableList<Integer> trackIndices
The indices 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> trackIndices)
Constructs an instance to forcetrackIndicesintrackGroupto be selected.- Parameters:
trackGroup- TheTrackGroupfor which to override the track selection.trackIndices- The indices of the tracks in theTrackGroupto select.
-
-
Method Detail
-
getTrackType
public @com.google.android.exoplayer2.C.TrackType int getTrackType()
Returns theC.TrackTypeof the overriden track group.
-
toBundle
public Bundle toBundle()
Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-