docs/doc/reference/com/google/android/exoplayer2/source/TrackGroupArray.html
Package com.google.android.exoplayer2.source
All Implemented Interfaces:Bundleable
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classTrackGroupArrayextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Bundleable](../Bundleable.html "interface in com.google.android.exoplayer2")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
An immutable array of TrackGroups.
This class is typically used to represent all of the tracks available in a piece of media. Tracks that are known to present the same content are grouped together (e.g., the same video feed provided at different resolutions in an adaptive stream). Tracks that are known to present different content are in separate track groups (e.g., an audio track will not be in the same group as a video track, and an audio track in one language will be in a different group to an audio track in another language).
-
Bundleable.Creator<T extends Bundleable>
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static Bundleable.Creator<TrackGroupArray> | CREATOR |
Deprecated.
Object that can restores a TrackGroupArray from a Bundle.
|
| static TrackGroupArray | EMPTY |
Deprecated.
The empty array.
|
| int | length |
Deprecated.
The number of groups in the array. |
Constructors | Constructor | Description |
| --- | --- |
| TrackGroupArray(TrackGroup... trackGroups) |
Deprecated.
Construct a TrackGroupArray from an array of TrackGroups.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| boolean | equals(Object obj) |
Deprecated.
|
| TrackGroup | get(int index) |
Deprecated.
Returns the group at a given index.
|
| int | hashCode() |
Deprecated.
|
| int | indexOf(TrackGroup group) |
Deprecated.
Returns the index of a group within the array.
|
| boolean | isEmpty() |
Deprecated.
Returns whether this track group array is empty.
|
| Bundle | toBundle() |
Deprecated.
Returns a Bundle representing the information stored in this object.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
public static final[TrackGroupArray](TrackGroupArray.html "class in com.google.android.exoplayer2.source")EMPTY
Deprecated.
The empty array.
-
public final int length
Deprecated.
The number of groups in the array. Greater than or equal to zero.
-
public static final[Bundleable.Creator](../Bundleable.Creator.html "interface in com.google.android.exoplayer2")<[TrackGroupArray](TrackGroupArray.html "class in com.google.android.exoplayer2.source")> CREATOR
Deprecated.
Object that can restores a TrackGroupArray from a Bundle.
-
public TrackGroupArray([TrackGroup](TrackGroup.html "class in com.google.android.exoplayer2.source")... trackGroups)
Deprecated.
Construct a TrackGroupArray from an array of TrackGroups.
The groups must not contain duplicates.
-
public[TrackGroup](TrackGroup.html "class in com.google.android.exoplayer2.source")get(int index)
Deprecated.
Returns the group at a given index.
Parameters:index - The index of the group.Returns:The group.
-
public int indexOf([TrackGroup](TrackGroup.html "class in com.google.android.exoplayer2.source")group)
Deprecated.
Returns the index of a group within the array.
Parameters:group - The group.Returns:The index of the group, or C.INDEX_UNSET if no such group exists.
-
public boolean isEmpty()
Deprecated.
Returns whether this track group array is empty.
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")obj)
Deprecated.
Overrides:equals in class Object
-
public[Bundle](https://developer.android.com/reference/android/os/Bundle.html "class or interface in android.os")toBundle()
Deprecated.
Description copied from interface: Bundleable
Returns a Bundle representing the information stored in this object.
Specified by:toBundle in interface Bundleable