Class TrackSelectionOverrides
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionOverrides
-
- All Implemented Interfaces:
Bundleable
public final class TrackSelectionOverrides extends Object implements Bundleable
Forces the selection of the specified tracks inTrackGroups
.Each
override
only affects the selection of tracks of thattype
. For example overriding the selection of anaudio
TrackGroup
will not affect the selection ofvideo
ortext
tracks.If multiple
TrackGroups
of the sameC.TrackType
are overridden, which tracks will be selected depend on the player capabilities. For example, by defaultExoPlayer
doesn't support selecting more than oneTrackGroup
perC.TrackType
.Overrides of
TrackGroup
that are not currently available are ignored. For example, when the player transitions to the nextMediaItem
in a playlist, any overrides of the previousMediaItem
are ignored.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TrackSelectionOverrides.Builder
Builder forTrackSelectionOverrides
.static class
TrackSelectionOverrides.TrackSelectionOverride
Forces the selection ofTrackSelectionOverrides.TrackSelectionOverride.trackIndices
for aTrackGroup
.-
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>
CREATOR
Object that can restoreTrackSelectionOverrides
from aBundle
.static TrackSelectionOverrides
EMPTY
EmptyTrackSelectionOverrides
, where no track selection is overridden.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableList<TrackSelectionOverrides.TrackSelectionOverride>
asList()
Returns a list of theoverrides
.TrackSelectionOverrides.Builder
buildUpon()
Returns aTrackSelectionOverrides.Builder
initialized with the values of this instance.boolean
equals(Object obj)
TrackSelectionOverrides.TrackSelectionOverride
getOverride(TrackGroup trackGroup)
Returns theTrackSelectionOverrides.TrackSelectionOverride
of the providedTrackGroup
ornull
if there is none.int
hashCode()
Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
EMPTY
public static final TrackSelectionOverrides EMPTY
EmptyTrackSelectionOverrides
, where no track selection is overridden.
-
CREATOR
public static final Bundleable.Creator<TrackSelectionOverrides> CREATOR
Object that can restoreTrackSelectionOverrides
from aBundle
.
-
-
Method Detail
-
buildUpon
public TrackSelectionOverrides.Builder buildUpon()
Returns aTrackSelectionOverrides.Builder
initialized with the values of this instance.
-
asList
public ImmutableList<TrackSelectionOverrides.TrackSelectionOverride> asList()
Returns a list of theoverrides
.
-
getOverride
@Nullable public TrackSelectionOverrides.TrackSelectionOverride getOverride(TrackGroup trackGroup)
Returns theTrackSelectionOverrides.TrackSelectionOverride
of the providedTrackGroup
ornull
if there is none.
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-