Stay organized with collections Save and categorize content based on your preferences.

DefaultHlsExtractorFactory

@UnstableApi
public final class DefaultHlsExtractorFactory implements HlsExtractorFactory


Default HlsExtractorFactory implementation.

Summary

Public constructors

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

DefaultHlsExtractorFactory(
    int payloadReaderFactoryFlags,
    boolean exposeCea608WhenMissingDeclarations
)

Creates a factory for HLS segment extractors.

Public methods

BundledHlsMediaChunkExtractor
createExtractor(
    Uri uri,
    Format format,
    @Nullable List<Format> muxedCaptionFormats,
    TimestampAdjuster timestampAdjuster,
    Map<StringList<String>> responseHeaders,
    ExtractorInput sniffingExtractorInput,
    PlayerId playerId
)

Creates an Extractor for extracting HLS media chunks.

Public constructors

DefaultHlsExtractorFactory

public DefaultHlsExtractorFactory(
    int payloadReaderFactoryFlags,
    boolean exposeCea608WhenMissingDeclarations
)

Creates a factory for HLS segment extractors.

Parameters
int payloadReaderFactoryFlags

Flags to add when constructing any instances. Other flags may be added on top of payloadReaderFactoryFlags when creating DefaultTsPayloadReaderFactory.

boolean exposeCea608WhenMissingDeclarations

Whether created TsExtractor instances should expose a CEA-608 track should the multivariant playlist contain no Closed Captions declarations. If the multivariant playlist contains any Closed Captions declarations, this flag is ignored.

Public methods

createExtractor

public BundledHlsMediaChunkExtractor createExtractor(
    Uri uri,
    Format format,
    @Nullable List<Format> muxedCaptionFormats,
    TimestampAdjuster timestampAdjuster,
    Map<StringList<String>> responseHeaders,
    ExtractorInput sniffingExtractorInput,
    PlayerId playerId
)

Creates an Extractor for extracting HLS media chunks.

Parameters
Uri uri

The URI of the media chunk.

Format format

A Format associated with the chunk to extract.

@Nullable List<Format> muxedCaptionFormats

List of muxed caption Formats. Null if no closed caption information is available in the multivariant playlist.

TimestampAdjuster timestampAdjuster

Adjuster corresponding to the provided discontinuity sequence number.

Map<StringList<String>> responseHeaders

The HTTP response headers associated with the media segment or initialization section to extract.

ExtractorInput sniffingExtractorInput

The first extractor input that will be passed to the returned extractor's read. Must only be used to call sniff.

PlayerId playerId

The PlayerId of the player using this extractors factory.

Throws
java.io.IOException java.io.IOException

If an I/O error is encountered while sniffing.