TrackSelectionOverride
public final class TrackSelectionOverride
A track selection override, consisting of a TrackGroup and the indices of the tracks within the group that should be selected.
A track selection override is applied during playback if the media being played contains a TrackGroup equal to the one in the override. If a TrackSelectionParameters contains only one override of a given track type that applies to the media, this override will be used to control the track selection for that type. If multiple overrides of a given track type apply then the player will apply only one of them.
If trackIndices is empty then the override specifies that no tracks should be selected. Adding an empty override to a TrackSelectionParameters is similar to disabling a track type, except that an empty override will only be applied if the media being played contains a TrackGroup equal to the one in the override. Conversely, disabling a track type will prevent selection of tracks of that type for all media.
Summary
Public fields |
|
|---|---|
final TrackGroup |
The media |
final ImmutableList<Integer> |
The indices of tracks in a |
Public constructors |
|---|
TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)Constructs an instance to force |
TrackSelectionOverride(Constructs an instance to force |
Public methods |
|
|---|---|
boolean |
|
static TrackSelectionOverride |
@UnstableApiRestores a |
int |
Returns the |
int |
hashCode() |
Bundle |
Public fields
mediaTrackGroup
public final TrackGroup mediaTrackGroup
The media TrackGroup whose trackIndices are forced to be selected.
trackIndices
public final ImmutableList<Integer> trackIndices
The indices of tracks in a TrackGroup to be selected.
Public constructors
TrackSelectionOverride
public TrackSelectionOverride(TrackGroup mediaTrackGroup, int trackIndex)
Constructs an instance to force trackIndex in trackGroup to be selected.
| Parameters | |
|---|---|
TrackGroup mediaTrackGroup |
The media |
int trackIndex |
The index of the track in the |
TrackSelectionOverride
public TrackSelectionOverride(
TrackGroup mediaTrackGroup,
List<Integer> trackIndices
)
Constructs an instance to force trackIndices in trackGroup to be selected.
| Parameters | |
|---|---|
TrackGroup mediaTrackGroup |
The media |
List<Integer> trackIndices |
The indices of the tracks in the |
Public methods
fromBundle
@UnstableApi
public static TrackSelectionOverride fromBundle(Bundle bundle)
Restores a TrackSelectionOverride from a Bundle.