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
overrideonly affects the selection of tracks of thattype. For example overriding the selection of anaudioTrackGroupwill not affect the selection ofvideoortexttracks.If multiple
TrackGroupsof the sameC.TrackTypeare overridden, which tracks will be selected depend on the player capabilities. For example, by defaultExoPlayerdoesn't support selecting more than oneTrackGroupperC.TrackType.Overrides of
TrackGroupthat are not currently available are ignored. For example, when the player transitions to the nextMediaItemin a playlist, any overrides of the previousMediaItemare ignored.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTrackSelectionOverrides.BuilderBuilder forTrackSelectionOverrides.static classTrackSelectionOverrides.TrackSelectionOverrideForces the selection ofTrackSelectionOverrides.TrackSelectionOverride.trackIndicesfor 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>CREATORObject that can restoreTrackSelectionOverridesfrom aBundle.static TrackSelectionOverridesEMPTYEmptyTrackSelectionOverrides, 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.BuilderbuildUpon()Returns aTrackSelectionOverrides.Builderinitialized with the values of this instance.booleanequals(Object obj)TrackSelectionOverrides.TrackSelectionOverridegetOverride(TrackGroup trackGroup)Returns theTrackSelectionOverrides.TrackSelectionOverrideof the providedTrackGroupornullif there is none.inthashCode()BundletoBundle()Returns aBundlerepresenting 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 restoreTrackSelectionOverridesfrom aBundle.
-
-
Method Detail
-
buildUpon
public TrackSelectionOverrides.Builder buildUpon()
Returns aTrackSelectionOverrides.Builderinitialized 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.TrackSelectionOverrideof the providedTrackGroupornullif there is none.
-
toBundle
public Bundle toBundle()
Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-