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

## Class HlsPlaylistParser

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

- All Implemented Interfaces:
    `ParsingLoadable.Parser<HlsPlaylist>`

      public final class HlsPlaylistParser
      extends Object
      implements ParsingLoadable.Parser<HlsPlaylist>

  HLS playlists parsing logic.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `HlsPlaylistParser.DeltaUpdateException` | Exception thrown when merging a delta update fails.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `HlsPlaylistParser()` | Creates an instance where media playlists are parsed without inheriting attributes from a multivariant playlist.
    `HlsPlaylistParser​(HlsMultivariantPlaylist multivariantPlaylist, HlsMediaPlaylist previousMediaPlaylist)` | Creates an instance where parsed media playlists inherit attributes from the given master playlist.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `HlsPlaylist` | `parse​(Uri uri, InputStream inputStream)` | Parses an object from a response.

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

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

- - ### Constructor Detail

    - #### HlsPlaylistParser

          public HlsPlaylistParser()

      Creates an instance where media playlists are parsed without inheriting attributes from a multivariant playlist.

    - #### HlsPlaylistParser

          public HlsPlaylistParser​(HlsMultivariantPlaylist multivariantPlaylist,
                                   @Nullable
                                   HlsMediaPlaylist previousMediaPlaylist)

      Creates an instance where parsed media playlists inherit attributes from the given master playlist.
      Parameters:
        `multivariantPlaylist` - The multivariant playlist from which media playlists will inherit attributes.
        `previousMediaPlaylist` - The previous media playlist from which the new media playlist may inherit skipped segments.

  - ### Method Detail

    - #### parse

          public HlsPlaylist parse​(Uri uri,
                                   InputStream inputStream)
                            throws IOException

      Description copied from interface: `ParsingLoadable.Parser`
      Parses an object from a response.
      Specified by:
        `parse` in interface `ParsingLoadable.Parser<HlsPlaylist>`
      Parameters:
        `uri` - The source `Uri` of the response, after any redirection.
        `inputStream` - An `InputStream` from which the response data can be read.
      Returns:
        The parsed object.
      Throws:
        `ParserException` - If an error occurs parsing the data.
        `IOException` - If an error occurs reading data from the stream.