Package com.google.android.exoplayer2
Class TracksInfo
- java.lang.Object
-
- com.google.android.exoplayer2.TracksInfo
-
- All Implemented Interfaces:
Bundleable
public final class TracksInfo extends Object implements Bundleable
Information about groups of tracks.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TracksInfo.TrackGroupInfo
Information about a single group of tracks, including the underlyingTrackGroup
, thetype
of tracks it contains, and the level to which each track is supported by the player.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description static Bundleable.Creator<TracksInfo>
CREATOR
Object that can restore aTracksInfo
from aBundle
.static TracksInfo
EMPTY
AnTrackInfo
that contains no tracks.
-
Constructor Summary
Constructors Constructor Description TracksInfo(List<TracksInfo.TrackGroupInfo> trackGroupInfos)
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
ImmutableList<TracksInfo.TrackGroupInfo>
getTrackGroupInfos()
Returns theTrackGroupInfos
describing the groups of tracks.int
hashCode()
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
isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of typetrackType
issupported
or if there are no tracks of this type.boolean
isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Returns true if at least one track of typetrackType
issupported
or if there are no tracks of this type.Bundle
toBundle()
Returns aBundle
representing the information stored in this object.
-
-
-
Field Detail
-
EMPTY
public static final TracksInfo EMPTY
AnTrackInfo
that contains no tracks.
-
CREATOR
public static final Bundleable.Creator<TracksInfo> CREATOR
Object that can restore aTracksInfo
from aBundle
.
-
-
Constructor Detail
-
TracksInfo
public TracksInfo(List<TracksInfo.TrackGroupInfo> trackGroupInfos)
Constructs an instance.- Parameters:
trackGroupInfos
- TheTrackGroupInfos
describing the groups of tracks.
-
-
Method Detail
-
getTrackGroupInfos
public ImmutableList<TracksInfo.TrackGroupInfo> getTrackGroupInfos()
Returns theTrackGroupInfos
describing the groups of tracks.
-
isTypeSupportedOrEmpty
public boolean isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType)
Returns true if at least one track of typetrackType
issupported
or if there are no tracks of this type.
-
isTypeSupportedOrEmpty
public boolean isTypeSupportedOrEmpty(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)
Returns true if at least one track of typetrackType
issupported
or if there are no tracks of this type.- 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.
-
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
-
-