public final class

TrackSelectionOverrides.TrackSelectionOverride

extends java.lang.Object

implements Bundleable

 java.lang.Object

↳androidx.media3.common.TrackSelectionOverrides.TrackSelectionOverride

Overview

Forces the selection of TrackSelectionOverrides.TrackSelectionOverride.trackIndices for a TrackGroup.

If multiple tracks in TrackSelectionOverrides.TrackSelectionOverride.trackGroup are overridden, as many as possible will be selected depending on the player capabilities.

If TrackSelectionOverrides.TrackSelectionOverride.trackIndices is empty, no tracks from TrackSelectionOverrides.TrackSelectionOverride.trackGroup will be played. This is similar to TrackSelectionParameters.disabledTrackTypes, except it will only affect the playback of the associated TrackGroup. For example, if the only C.TRACK_TYPE_VIDEO TrackGroup is associated with no tracks, no video will play until the next video starts.

Summary

Fields
public static final Bundleable.Creator<TrackSelectionOverrides.TrackSelectionOverride>CREATOR

Object that can restore TrackSelectionOverride from a .

public final TrackGrouptrackGroup

The TrackGroup whose TrackSelectionOverrides.TrackSelectionOverride.trackIndices are forced to be selected.

public final <any>trackIndices

The indices of tracks in a TrackGroup to be selected.

Constructors
publicTrackSelectionOverride(TrackGroup trackGroup)

Constructs an instance to force all tracks in trackGroup to be selected.

publicTrackSelectionOverride(TrackGroup trackGroup, java.util.List<java.lang.Integer> trackIndices)

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

Methods
public booleanequals(java.lang.Object obj)

public intgetTrackType()

Returns the C.TrackType of the overriden track group.

public inthashCode()

public BundletoBundle()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Fields

public final TrackGroup trackGroup

The TrackGroup whose TrackSelectionOverrides.TrackSelectionOverride.trackIndices are forced to be selected.

public final <any> trackIndices

The indices of tracks in a TrackGroup to be selected.

public static final Bundleable.Creator<TrackSelectionOverrides.TrackSelectionOverride> CREATOR

Object that can restore TrackSelectionOverride from a .

Constructors

public TrackSelectionOverride(TrackGroup trackGroup)

Constructs an instance to force all tracks in trackGroup to be selected.

public TrackSelectionOverride(TrackGroup trackGroup, java.util.List<java.lang.Integer> trackIndices)

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

Parameters:

trackGroup: The TrackGroup for which to override the track selection.
trackIndices: The indices of the tracks in the TrackGroup to select.

Methods

public boolean equals(java.lang.Object obj)

public int hashCode()

public int getTrackType()

Returns the C.TrackType of the overriden track group.

public Bundle toBundle()