TrackSelectionOverride


class TrackSelectionOverride : Bundleable


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

Constants

const Bundleable.Creator<TrackSelectionOverride!>!

This property is deprecated.

Use fromBundle instead.

Public constructors

TrackSelectionOverride(mediaTrackGroup: TrackGroup!, trackIndex: Int)

Constructs an instance to force trackIndex in trackGroup to be selected.

TrackSelectionOverride(
    mediaTrackGroup: TrackGroup!,
    trackIndices: (Mutable)List<Int!>!
)

Constructs an instance to force trackIndices in trackGroup to be selected.

Public functions

Boolean
equals(obj: Any?)
java-static TrackSelectionOverride!

Restores a TrackSelectionOverride from a Bundle.

Int

Returns the C.TrackType of the overridden track group.

Int
Bundle!

Returns a Bundle representing the information stored in this object.

Public properties

TrackGroup!

The media TrackGroup whose trackIndices are forced to be selected.

ImmutableList<Int!>!

The indices of tracks in a TrackGroup to be selected.

Constants

CREATOR

@UnstableApi
const val CREATORBundleable.Creator<TrackSelectionOverride!>!

Object that can restore TrackSelectionOverride from a Bundle.

Public constructors

TrackSelectionOverride

TrackSelectionOverride(mediaTrackGroup: TrackGroup!, trackIndex: Int)

Constructs an instance to force trackIndex in trackGroup to be selected.

Parameters
mediaTrackGroup: TrackGroup!

The media TrackGroup for which to override the track selection.

trackIndex: Int

The index of the track in the TrackGroup to select.

TrackSelectionOverride

TrackSelectionOverride(
    mediaTrackGroup: TrackGroup!,
    trackIndices: (Mutable)List<Int!>!
)

Constructs an instance to force trackIndices in trackGroup to be selected.

Parameters
mediaTrackGroup: TrackGroup!

The media TrackGroup for which to override the track selection.

trackIndices: (Mutable)List<Int!>!

The indices of the tracks in the TrackGroup to select.

Public functions

equals

fun equals(obj: Any?): Boolean

fromBundle

@UnstableApi
java-static fun fromBundle(bundle: Bundle!): TrackSelectionOverride!

Restores a TrackSelectionOverride from a Bundle.

getType

@C.TrackType
fun getType(): Int

Returns the C.TrackType of the overridden track group.

hashCode

fun hashCode(): Int

toBundle

@UnstableApi
fun toBundle(): Bundle!

Returns a Bundle representing the information stored in this object.

Public properties

mediaTrackGroup

val mediaTrackGroupTrackGroup!

The media TrackGroup whose trackIndices are forced to be selected.

trackIndices

val trackIndicesImmutableList<Int!>!

The indices of tracks in a TrackGroup to be selected.