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

## Class DefaultHlsExtractorFactory

- java.lang.Object
- - com.google.android.exoplayer2.source.hls.DefaultHlsExtractorFactory

- All Implemented Interfaces:
    `HlsExtractorFactory`

      public final class DefaultHlsExtractorFactory
      extends Object
      implements HlsExtractorFactory

  Default `HlsExtractorFactory` implementation.

- - ### Field Summary

    - ### Fields inherited from interface com.google.android.exoplayer2.source.hls.HlsExtractorFactory

      `DEFAULT`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultHlsExtractorFactory()` | Equivalent to `new DefaultHlsExtractorFactory(payloadReaderFactoryFlags = 0, exposeCea608WhenMissingDeclarations = true)`
    `DefaultHlsExtractorFactory​(int payloadReaderFactoryFlags, boolean exposeCea608WhenMissingDeclarations)` | Creates a factory for HLS segment extractors.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `BundledHlsMediaChunkExtractor` | `createExtractor​(Uri uri, Format format, List<Format> muxedCaptionFormats, TimestampAdjuster timestampAdjuster, Map<String,​List<String>> responseHeaders, ExtractorInput sniffingExtractorInput)` | Creates an `Extractor` for extracting HLS media chunks.

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

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

- - ### Constructor Detail

    - #### DefaultHlsExtractorFactory

          public DefaultHlsExtractorFactory()

      Equivalent to `new DefaultHlsExtractorFactory(payloadReaderFactoryFlags = 0, exposeCea608WhenMissingDeclarations = true)`

    - #### DefaultHlsExtractorFactory

          public DefaultHlsExtractorFactory​(int payloadReaderFactoryFlags,
                                            boolean exposeCea608WhenMissingDeclarations)

      Creates a factory for HLS segment extractors.
      Parameters:
        `payloadReaderFactoryFlags` - Flags to add when constructing any `DefaultTsPayloadReaderFactory` instances. Other flags may be added on top of `payloadReaderFactoryFlags` when creating `DefaultTsPayloadReaderFactory`.
        `exposeCea608WhenMissingDeclarations` - Whether created `TsExtractor` instances should expose a CEA-608 track should the master playlist contain no Closed Captions declarations. If the master playlist contains any Closed Captions declarations, this flag is ignored.

  - ### Method Detail

    - #### createExtractor

          public BundledHlsMediaChunkExtractor createExtractor​(Uri uri,
                                                               Format format,
                                                               @Nullable
                                                               List<Format> muxedCaptionFormats,
                                                               TimestampAdjuster timestampAdjuster,
                                                               Map<String,​List<String>> responseHeaders,
                                                               ExtractorInput sniffingExtractorInput)
                                                        throws IOException

      Description copied from interface: `HlsExtractorFactory`
      Creates an `Extractor` for extracting HLS media chunks.
      Specified by:
        `createExtractor` in interface `HlsExtractorFactory`
      Parameters:
        `uri` - The URI of the media chunk.
        `format` - A `Format` associated with the chunk to extract.
        `muxedCaptionFormats` - List of muxed caption `Format`s. Null if no closed caption information is available in the master playlist.
        `timestampAdjuster` - Adjuster corresponding to the provided discontinuity sequence number.
        `responseHeaders` - The HTTP response headers associated with the media segment or initialization section to extract.
        `sniffingExtractorInput` - The first extractor input that will be passed to the returned extractor's `Extractor.read(ExtractorInput, PositionHolder)`. Must only be used to call `Extractor.sniff(ExtractorInput)`.
      Returns:
        An `HlsMediaChunkExtractor`.
      Throws:
        `IOException` - If an I/O error is encountered while sniffing.