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

## Class FilteringHlsPlaylistParserFactory

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

- All Implemented Interfaces:
    `HlsPlaylistParserFactory`

      public final class FilteringHlsPlaylistParserFactory
      extends Object
      implements HlsPlaylistParserFactory

  A `HlsPlaylistParserFactory` that includes only the streams identified by the given stream keys.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FilteringHlsPlaylistParserFactory​(HlsPlaylistParserFactory hlsPlaylistParserFactory, List<StreamKey> streamKeys)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ParsingLoadable.Parser<HlsPlaylist>` | `createPlaylistParser()` | Returns a stand-alone playlist parser.
    `ParsingLoadable.Parser<HlsPlaylist>` | `createPlaylistParser​(HlsMultivariantPlaylist multivariantPlaylist, HlsMediaPlaylist previousMediaPlaylist)` | Returns a playlist parser for playlists that were referenced by the given `HlsMultivariantPlaylist`.

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

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

- - ### Constructor Detail

    - #### FilteringHlsPlaylistParserFactory

          public FilteringHlsPlaylistParserFactory​(HlsPlaylistParserFactory hlsPlaylistParserFactory,
                                                   List<StreamKey> streamKeys)

      Parameters:
        `hlsPlaylistParserFactory` - A factory for the parsers of the playlists which will be filtered.
        `streamKeys` - The stream keys. If null or empty then filtering will not occur.

  - ### Method Detail

    - #### createPlaylistParser

          public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser()

      Description copied from interface: `HlsPlaylistParserFactory`
      Returns a stand-alone playlist parser. Playlists parsed by the returned parser do not inherit any attributes from other playlists.
      Specified by:
        `createPlaylistParser` in interface `HlsPlaylistParserFactory`

    - #### createPlaylistParser

          public ParsingLoadable.Parser<HlsPlaylist> createPlaylistParser​(HlsMultivariantPlaylist multivariantPlaylist,
                                                                          @Nullable
                                                                          HlsMediaPlaylist previousMediaPlaylist)

      Description copied from interface: `HlsPlaylistParserFactory`
      Returns a playlist parser for playlists that were referenced by the given `HlsMultivariantPlaylist`. Returned `HlsMediaPlaylist` instances may inherit attributes from `multivariantPlaylist`.
      Specified by:
        `createPlaylistParser` in interface `HlsPlaylistParserFactory`
      Parameters:
        `multivariantPlaylist` - The multivariant playlist that referenced any parsed media playlists.
        `previousMediaPlaylist` - The previous media playlist or null if there is no previous media playlist.
      Returns:
        A parser for HLS playlists.