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 classTracks.GroupInformation 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 booleancontainsType(@com.google.android.exoplayer2.C.TrackType int trackType)Returns true if there are tracks of typetrackType, and false otherwise.booleanequals(Object other)ImmutableList<Tracks.Group>getGroups()Returns thegroupsof tracks.inthashCode()booleanisEmpty()Returnstrueif there are no tracks, andfalseotherwise.booleanisTypeSelected(@com.google.android.exoplayer2.C.TrackType int trackType)Returns true if at least one track of the typetrackTypeis selected for playback.booleanisTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType)Returns true if at least one track of typetrackTypeissupported.booleanisTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)Returns true if at least one track of typetrackTypeissupported.booleanisTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType)Deprecated.UsecontainsType(int)andisTypeSupported(int).booleanisTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)Deprecated.BundletoBundle()Returns aBundlerepresenting 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- Thegroupsof tracks.
-
-
Method Detail
-
getGroups
public ImmutableList<Tracks.Group> getGroups()
Returns thegroupsof tracks.
-
isEmpty
public boolean isEmpty()
Returnstrueif there are no tracks, andfalseotherwise.
-
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 typetrackTypeissupported.
-
isTypeSupported
public boolean isTypeSupported(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)Returns true if at least one track of typetrackTypeissupported.- Parameters:
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 typetrackTypeis selected for playback.
-
toBundle
public Bundle toBundle()
Description copied from interface:BundleableReturns aBundlerepresenting the information stored in this object.- Specified by:
toBundlein interfaceBundleable
-
-