public final class Tracks


Information about groups of tracks.

Summary

Nested types

public final class Tracks.Group

Information about a single group of tracks, including the underlying TrackGroup, the level to which each track is supported by the player, and whether any of the tracks are selected.

Constants

static final Tracks

Empty tracks.

Public fields

final ImmutableList<Tracks.Group>

Public constructors

Constructs an instance.

Public methods

boolean
containsType(@C.TrackType int trackType)

Returns true if there are tracks of type trackType, and false otherwise.

boolean
static Tracks

Restores a Tracks from a Bundle.

ImmutableList<Tracks.Group>

Returns the groups of tracks.

int
boolean

Returns true if there are no tracks, and false otherwise.

boolean
isTypeSelected(@C.TrackType int trackType)

Returns true if at least one track of the type trackType is selected for playback.

boolean
isTypeSupported(@C.TrackType int trackType)

Returns true if at least one track of type trackType is supported.

boolean
isTypeSupported(
    @C.TrackType int trackType,
    boolean allowExceedsCapabilities
)

Returns true if at least one track of type trackType is supported.

boolean

This method is deprecated.

Use containsType and isTypeSupported.

boolean
@UnstableApi
isTypeSupportedOrEmpty(
    @C.TrackType int trackType,
    boolean allowExceedsCapabilities
)

This method is deprecated.

Use containsType and isTypeSupported.

Bundle

Constants

EMPTY

public static final Tracks EMPTY

Empty tracks.

Public fields

groups

public final ImmutableList<Tracks.Groupgroups

Public constructors

Tracks

@UnstableApi
public Tracks(List<Tracks.Group> groups)

Constructs an instance.

Parameters
List<Tracks.Group> groups

The groups of tracks.

Public methods

containsType

public boolean containsType(@C.TrackType int trackType)

Returns true if there are tracks of type trackType, and false otherwise.

equals

public boolean equals(@Nullable Object other)

fromBundle

@UnstableApi
public static Tracks fromBundle(Bundle bundle)

Restores a Tracks from a Bundle.

getGroups

public ImmutableList<Tracks.GroupgetGroups()

Returns the groups of tracks.

hashCode

public int hashCode()

isEmpty

public boolean isEmpty()

Returns true if there are no tracks, and false otherwise.

isTypeSelected

public boolean isTypeSelected(@C.TrackType int trackType)

Returns true if at least one track of the type trackType is selected for playback.

isTypeSupported

public boolean isTypeSupported(@C.TrackType int trackType)

Returns true if at least one track of type trackType is supported.

isTypeSupported

public boolean isTypeSupported(
    @C.TrackType int trackType,
    boolean allowExceedsCapabilities
)

Returns true if at least one track of type trackType is supported.

Parameters
@C.TrackType int trackType

The track type to query support for.

boolean allowExceedsCapabilities

Whether to consider the track as supported if it has a supported MIME type, but otherwise exceeds the advertised capabilities of the device. For example, a video track for which there's a corresponding decoder whose maximum advertised resolution is exceeded by the resolution of the track. Such tracks may be playable in some cases.

isTypeSupportedOrEmpty

@UnstableApi
public boolean isTypeSupportedOrEmpty(@C.TrackType int trackType)

isTypeSupportedOrEmpty

@UnstableApi
public boolean isTypeSupportedOrEmpty(
    @C.TrackType int trackType,
    boolean allowExceedsCapabilities
)

toBundle

@UnstableApi
public Bundle toBundle()