TrackGroupArray


@UnstableApi
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

const TrackGroupArray!

The empty array.

Public constructors

TrackGroupArray(trackGroups: Array<TrackGroup!>!)

Construct a TrackGroupArray from an array of TrackGroups.

Public functions

Boolean
equals(obj: Any?)
java-static TrackGroupArray!
fromBundle(bundle: Bundle!)

Restores a TrackGroupArray from a Bundle.

TrackGroup!
get(index: Int)

Returns the group at a given index.

ImmutableList<@C.TrackType Int!>!

Returns the type of each track group in this array.

Int
Int

Returns the index of a group within the array.

Boolean

Returns whether this track group array is empty.

Bundle!

Public properties

Int

The number of groups in the array.

Constants

EMPTY

const val EMPTYTrackGroupArray!

The empty array.

Public constructors

TrackGroupArray

TrackGroupArray(trackGroups: Array<TrackGroup!>!)

Construct a TrackGroupArray from an array of TrackGroups.

The groups must not contain duplicates.

Public functions

equals

fun equals(obj: Any?): Boolean

fromBundle

java-static fun fromBundle(bundle: Bundle!): TrackGroupArray!

Restores a TrackGroupArray from a Bundle.

get

fun get(index: Int): TrackGroup!

Returns the group at a given index.

Parameters
index: Int

The index of the group.

Returns
TrackGroup!

The group.

getTrackTypes

fun getTrackTypes(): ImmutableList<@C.TrackType Int!>!

Returns the type of each track group in this array.

hashCode

fun hashCode(): Int

indexOf

fun indexOf(group: TrackGroup!): Int

Returns the index of a group within the array.

Parameters
group: TrackGroup!

The group.

Returns
Int

The index of the group, or INDEX_UNSET if no such group exists.

isEmpty

fun isEmpty(): Boolean

Returns whether this track group array is empty.

toBundle

fun toBundle(): Bundle!

Public properties

length

val lengthInt

The number of groups in the array. Greater than or equal to zero.