TrackGroupArray
@UnstableApi
public final class TrackGroupArray
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).
Summary
Constants |
|
|---|---|
static final TrackGroupArray |
The empty array. |
Public fields |
|
|---|---|
final int |
The number of groups in the array. |
Public constructors |
|---|
TrackGroupArray(TrackGroup[] trackGroups)Construct a |
Public methods |
|
|---|---|
boolean |
|
static TrackGroupArray |
fromBundle(Bundle bundle)Restores a |
TrackGroup |
get(int index)Returns the group at a given index. |
ImmutableList<@C.TrackType Integer> |
Returns the |
int |
hashCode() |
int |
indexOf(TrackGroup group)Returns the index of a group within the array. |
boolean |
isEmpty()Returns whether this track group array is empty. |
Bundle |
toBundle() |
String |
toString() |
Constants
Public fields
Public constructors
TrackGroupArray
public TrackGroupArray(TrackGroup[] trackGroups)
Construct a TrackGroupArray from an array of TrackGroups.
The groups must not contain duplicates.
Public methods
fromBundle
public static TrackGroupArray fromBundle(Bundle bundle)
Restores a TrackGroupArray from a Bundle.
get
public TrackGroup get(int index)
Returns the group at a given index.
| Parameters | |
|---|---|
int index |
The index of the group. |
| Returns | |
|---|---|
TrackGroup |
The group. |
getTrackTypes
public ImmutableList<@C.TrackType Integer> getTrackTypes()
Returns the type of each track group in this array.
indexOf
public int indexOf(TrackGroup group)
Returns the index of a group within the array.
| Parameters | |
|---|---|
TrackGroup group |
The group. |
| Returns | |
|---|---|
int |
The index of the group, or |