Package com.google.android.exoplayer2
Class Tracks
- java.lang.Object
-
- com.google.android.exoplayer2.Tracks
-
- All Implemented Interfaces:
Bundleable
public final class Tracks extends Object implements Bundleable
Information about groups of tracks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Tracks.Group
Information about a single group of tracks, including the underlyingTrackGroup
, the level to which each track is supported by the player, and whether any of the tracks are selected.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Constructor Summary
Constructors Constructor Description Tracks(List<Tracks.Group> groups)
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
containsType(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if there are tracks of typetrackType
, and false otherwise.boolean
equals(Object other)
ImmutableList<Tracks.Group>
getGroups()
Returns thegroups
of tracks.int
hashCode()
boolean
isEmpty()
Returnstrue
if there are no tracks, andfalse
otherwise.boolean
isTypeSelected(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of the typetrackType
is selected for playback.boolean
isTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of typetrackType
issupported
.boolean
isTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Returns true if at least one track of typetrackType
issupported
.boolean
isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType)
Deprecated.UsecontainsType(int)
andisTypeSupported(int)
.boolean
isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Deprecated.Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
EMPTY
public static final Tracks EMPTY
Empty tracks.
-
CREATOR
public static final Bundleable.Creator<Tracks> CREATOR
Object that can restore tracks from aBundle
.
-
-
Constructor Detail
-
Tracks
public Tracks(List<Tracks.Group> groups)
Constructs an instance.- Parameters:
groups
- Thegroups
of tracks.
-
-
Method Detail
-
getGroups
public ImmutableList<Tracks.Group> getGroups()
Returns thegroups
of tracks.
-
isEmpty
public boolean isEmpty()
Returnstrue
if there are no tracks, andfalse
otherwise.
-
containsType
public boolean containsType(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if there are tracks of typetrackType
, and false otherwise.
-
isTypeSupported
public boolean isTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of typetrackType
issupported
.
-
isTypeSupported
public boolean isTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Returns true if at least one track of typetrackType
issupported
.- Parameters:
trackType
- The track type to query support for.allowExceedsCapabilities
- Whether to consider the track as supported if it has a supportedMIME 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
@Deprecated public boolean isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType)
Deprecated.UsecontainsType(int)
andisTypeSupported(int)
.
-
isTypeSupportedOrEmpty
@Deprecated public boolean isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Deprecated.
-
isTypeSelected
public boolean isTypeSelected(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of the typetrackType
is selected for playback.
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
-
-