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 oftrackIndices
for aTrackGroup
.If multiple tracks in
trackGroup
are overridden, as many as possible will be selected depending on the player capabilities.If
trackIndices
is empty, no tracks fromtrackGroup
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_VIDEO
TrackGroup
is 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>
CREATOR
Object that can restoreTrackSelectionOverride
from aBundle
.TrackGroup
trackGroup
TheTrackGroup
whosetrackIndices
are forced to be selected.ImmutableList<Integer>
trackIndices
The indices of tracks in aTrackGroup
to be selected.
-
Constructor Summary
Constructors Constructor Description TrackSelectionOverride(TrackGroup trackGroup)
Constructs an instance to force all tracks intrackGroup
to be selected.TrackSelectionOverride(TrackGroup trackGroup, List<Integer> trackIndices)
Constructs an instance to forcetrackIndices
intrackGroup
to be selected.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
@com.google.android.exoplayer2.C.TrackType int
getTrackType()
Returns theC.TrackType
of the overriden track group.int
hashCode()
Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
trackGroup
public final TrackGroup trackGroup
TheTrackGroup
whosetrackIndices
are forced to be selected.
-
trackIndices
public final ImmutableList<Integer> trackIndices
The indices of tracks in aTrackGroup
to be selected.
-
CREATOR
public static final Bundleable.Creator<TrackSelectionOverrides.TrackSelectionOverride> CREATOR
Object that can restoreTrackSelectionOverride
from aBundle
.
-
-
Constructor Detail
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup trackGroup)
Constructs an instance to force all tracks intrackGroup
to be selected.
-
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup trackGroup, List<Integer> trackIndices)
Constructs an instance to forcetrackIndices
intrackGroup
to be selected.- Parameters:
trackGroup
- TheTrackGroup
for which to override the track selection.trackIndices
- The indices of the tracks in theTrackGroup
to select.
-
-
Method Detail
-
getTrackType
public @com.google.android.exoplayer2.C.TrackType int getTrackType()
Returns theC.TrackType
of the overriden track group.
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-