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 underlying `TrackGroup`, 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>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Bundleable.Creator<Tracks>` | `CREATOR` | Object that can restore tracks from a `Bundle`.
    `static Tracks` | `EMPTY` | Empty tracks.

  - ### 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 type `trackType`, and false otherwise.
    `boolean` | `equals​(Object other)` |
    `ImmutableList<Tracks.Group>` | `getGroups()` | Returns the `groups` of tracks.
    `int` | `hashCode()` |
    `boolean` | `isEmpty()` | Returns `true` if there are no tracks, and `false` otherwise.
    `boolean` | `isTypeSelected​(@com.google.android.exoplayer2.C.TrackType int trackType)` | Returns true if at least one track of the type `trackType` is selected for playback.
    `boolean` | `isTypeSupported​(@com.google.android.exoplayer2.C.TrackType int trackType)` | Returns true if at least one track of type `trackType` is `supported`.
    `boolean` | `isTypeSupported​(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)` | Returns true if at least one track of type `trackType` is `supported`.
    `boolean` | `isTypeSupportedOrEmpty​(@com.google.android.exoplayer2.C.TrackType int trackType)` | Deprecated. Use `containsType(int)` and `isTypeSupported(int)`.
    `boolean` | `isTypeSupportedOrEmpty​(@com.google.android.exoplayer2.C.TrackType int trackType, boolean allowExceedsCapabilities)` | Deprecated. Use `containsType(int)` and `isTypeSupported(int, boolean)`.
    `Bundle` | `toBundle()` | Returns a `Bundle` representing the information stored in this object.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EMPTY

          public static final Tracks EMPTY

      Empty tracks.

    - #### CREATOR

          public static final Bundleable.Creator<Tracks> CREATOR

      Object that can restore tracks from a `Bundle`.

  - ### Constructor Detail

    - #### Tracks

          public Tracks​(List<Tracks.Group> groups)

      Constructs an instance.
      Parameters:
        `groups` - The `groups` of tracks.

  - ### Method Detail

    - #### getGroups

          public ImmutableList<Tracks.Group> getGroups()

      Returns the `groups` of tracks.

    - #### isEmpty

          public boolean isEmpty()

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

    - #### containsType

          public boolean containsType​(@com.google.android.exoplayer2.C.TrackType int trackType)

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

    - #### isTypeSupported

          public boolean isTypeSupported​(@com.google.android.exoplayer2.C.TrackType int trackType)

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

    - #### isTypeSupported

          public boolean isTypeSupported​(@com.google.android.exoplayer2.C.TrackType int trackType,
                                         boolean allowExceedsCapabilities)

      Returns true if at least one track of type `trackType` is `supported`.
      Parameters:
        `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

          @Deprecated
          public boolean isTypeSupportedOrEmpty​(@com.google.android.exoplayer2.C.TrackType int trackType)

      Deprecated.
      Use `containsType(int)` and `isTypeSupported(int)`.

    - #### isTypeSupportedOrEmpty

          @Deprecated
          public boolean isTypeSupportedOrEmpty​(@com.google.android.exoplayer2.C.TrackType int trackType,
                                                boolean allowExceedsCapabilities)

      Deprecated.
      Use `containsType(int)` and `isTypeSupported(int, boolean)`.

    - #### isTypeSelected

          public boolean isTypeSelected​(@com.google.android.exoplayer2.C.TrackType int trackType)

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

    - #### equals

          public boolean equals​(@Nullable
                                Object other)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toBundle

          public Bundle toBundle()

      Description copied from interface: `Bundleable`
      Returns a `Bundle` representing the information stored in this object.
      Specified by:
        `toBundle` in interface `Bundleable`