Package com.google.android.exoplayer2.source.hls.playlist

## Class HlsMasterPlaylist

- java.lang.Object
- - com.google.android.exoplayer2.source.hls.playlist.HlsPlaylist
  - - com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist

- All Implemented Interfaces:
    `FilterableManifest<HlsPlaylist>`

      public final class HlsMasterPlaylist
      extends HlsPlaylist

  Represents an HLS master playlist.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `HlsMasterPlaylist.Rendition` | A rendition (i.e.
    `static class` | `HlsMasterPlaylist.Variant` | A variant (i.e.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<HlsMasterPlaylist.Rendition>` | `audios` | The audio renditions declared by the playlist.
    `List<HlsMasterPlaylist.Rendition>` | `closedCaptions` | The closed caption renditions declared by the playlist.
    `static HlsMasterPlaylist` | `EMPTY` | Represents an empty master playlist, from which no attributes can be inherited.
    `static int` | `GROUP_INDEX_AUDIO` |
    `static int` | `GROUP_INDEX_SUBTITLE` |
    `static int` | `GROUP_INDEX_VARIANT` |
    `List<Uri>` | `mediaPlaylistUrls` | All of the media playlist URLs referenced by the playlist.
    `Format` | `muxedAudioFormat` | The format of the audio muxed in the variants.
    `List<Format>` | `muxedCaptionFormats` | The format of the closed captions declared by the playlist.
    `List<DrmInitData>` | `sessionKeyDrmInitData` | DRM initialization data derived from #EXT-X-SESSION-KEY tags.
    `List<HlsMasterPlaylist.Rendition>` | `subtitles` | The subtitle renditions declared by the playlist.
    `Map<String,​String>` | `variableDefinitions` | Contains variable definitions, as defined by the #EXT-X-DEFINE tag.
    `List<HlsMasterPlaylist.Variant>` | `variants` | The variants declared by the playlist.
    `List<HlsMasterPlaylist.Rendition>` | `videos` | The video renditions declared by the playlist.

    - ### Fields inherited from class com.google.android.exoplayer2.source.hls.playlist.HlsPlaylist

      `baseUri, hasIndependentSegments, tags`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HlsMasterPlaylist​(String baseUri, List<String> tags, List<HlsMasterPlaylist.Variant> variants, List<HlsMasterPlaylist.Rendition> videos, List<HlsMasterPlaylist.Rendition> audios, List<HlsMasterPlaylist.Rendition> subtitles, List<HlsMasterPlaylist.Rendition> closedCaptions, Format muxedAudioFormat, List<Format> muxedCaptionFormats, boolean hasIndependentSegments, Map<String,​String> variableDefinitions, List<DrmInitData> sessionKeyDrmInitData)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `HlsMasterPlaylist` | `copy​(List<StreamKey> streamKeys)` | Returns a copy of the manifest including only the streams specified by the given keys.
    `static HlsMasterPlaylist` | `createSingleVariantMasterPlaylist​(String variantUrl)` | Creates a playlist with a single variant.

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

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

- - ### Field Detail

    - #### EMPTY

          public static final HlsMasterPlaylist EMPTY

      Represents an empty master playlist, from which no attributes can be inherited.

    - #### GROUP_INDEX_VARIANT

          public static final int GROUP_INDEX_VARIANT

      See Also:
        Constant Field Values

    - #### GROUP_INDEX_AUDIO

          public static final int GROUP_INDEX_AUDIO

      See Also:
        Constant Field Values

    - #### GROUP_INDEX_SUBTITLE

          public static final int GROUP_INDEX_SUBTITLE

      See Also:
        Constant Field Values

    - #### mediaPlaylistUrls

          public final List<Uri> mediaPlaylistUrls

      All of the media playlist URLs referenced by the playlist.

    - #### variants

          public final List<HlsMasterPlaylist.Variant> variants

      The variants declared by the playlist.

    - #### videos

          public final List<HlsMasterPlaylist.Rendition> videos

      The video renditions declared by the playlist.

    - #### audios

          public final List<HlsMasterPlaylist.Rendition> audios

      The audio renditions declared by the playlist.

    - #### subtitles

          public final List<HlsMasterPlaylist.Rendition> subtitles

      The subtitle renditions declared by the playlist.

    - #### closedCaptions

          public final List<HlsMasterPlaylist.Rendition> closedCaptions

      The closed caption renditions declared by the playlist.

    - #### muxedAudioFormat

          @Nullable
          public final Format muxedAudioFormat

      The format of the audio muxed in the variants. May be null if the playlist does not declare any muxed audio.

    - #### muxedCaptionFormats

          @Nullable
          public final List<Format> muxedCaptionFormats

      The format of the closed captions declared by the playlist. May be empty if the playlist explicitly declares no captions are available, or null if the playlist does not declare any captions information.

    - #### variableDefinitions

          public final Map<String,​String> variableDefinitions

      Contains variable definitions, as defined by the #EXT-X-DEFINE tag.

    - #### sessionKeyDrmInitData

          public final List<DrmInitData> sessionKeyDrmInitData

      DRM initialization data derived from #EXT-X-SESSION-KEY tags.

  - ### Constructor Detail

    - #### HlsMasterPlaylist

          public HlsMasterPlaylist​(String baseUri,
                                   List<String> tags,
                                   List<HlsMasterPlaylist.Variant> variants,
                                   List<HlsMasterPlaylist.Rendition> videos,
                                   List<HlsMasterPlaylist.Rendition> audios,
                                   List<HlsMasterPlaylist.Rendition> subtitles,
                                   List<HlsMasterPlaylist.Rendition> closedCaptions,
                                   @Nullable
                                   Format muxedAudioFormat,
                                   @Nullable
                                   List<Format> muxedCaptionFormats,
                                   boolean hasIndependentSegments,
                                   Map<String,​String> variableDefinitions,
                                   List<DrmInitData> sessionKeyDrmInitData)

      Parameters:
        `baseUri` - See `HlsPlaylist.baseUri`.
        `tags` - See `HlsPlaylist.tags`.
        `variants` - See `variants`.
        `videos` - See `videos`.
        `audios` - See `audios`.
        `subtitles` - See `subtitles`.
        `closedCaptions` - See `closedCaptions`.
        `muxedAudioFormat` - See `muxedAudioFormat`.
        `muxedCaptionFormats` - See `muxedCaptionFormats`.
        `hasIndependentSegments` - See `HlsPlaylist.hasIndependentSegments`.
        `variableDefinitions` - See `variableDefinitions`.
        `sessionKeyDrmInitData` - See `sessionKeyDrmInitData`.

  - ### Method Detail

    - #### copy

          public HlsMasterPlaylist copy​(List<StreamKey> streamKeys)

      Description copied from interface: `FilterableManifest`
      Returns a copy of the manifest including only the streams specified by the given keys. If the manifest is unchanged then the instance may return itself.
      Parameters:
        `streamKeys` - A non-empty list of stream keys.
      Returns:
        The filtered manifest.

    - #### createSingleVariantMasterPlaylist

          public static HlsMasterPlaylist createSingleVariantMasterPlaylist​(String variantUrl)

      Creates a playlist with a single variant.
      Parameters:
        `variantUrl` - The url of the single variant.
      Returns:
        A master playlist with a single variant for the provided url.