interface TrackExtractorOptions {
    bufferDurationMaxSeconds?: number;
    bufferDurationMinSeconds?: number;
    bufferRatioMax?: number;
    bufferRatioMin?: number;
    maxNumDecodeFailures?: number;
    maxNumNetworkFailures?: number;
    probeChunkSizeMaxBytes?: number;
    probeChunkSizeMinBytes?: number;
    quotaExceededKeepWindowSizeSeconds?: number;
    seekLookBehindSeconds?: number;
    segmentDownloadChunkSizeMaxBytes?: number;
    segmentDownloadChunkSizeMinBytes?: number;
    segmentDownloadChunkSizeTargetSeconds?: number;
    segmentationProcessSamplesSizeSeconds?: number;
    subtitleCodecTypesImsc?: string[];
    subtitleCodecTypesScc?: string[];
    subtitleCodecTypesVtt?: string[];
    subtitleExtractionChunkSize?: number;
    titleBlockList?: string[];
    updateUrl?: ((response) => Promise<string>);
    verbose?: boolean | LogLevel;
}

Properties

bufferDurationMaxSeconds?: number

The maximum number of seconds to buffer ahead of the current position.

Default: 60

bufferDurationMinSeconds?: number

The minimum number of seconds to buffer ahead of the current position.

Default: 10

bufferRatioMax?: number

The maximum ratio to buffer ahead of the current position.

Ratio is "buffered duration left to play" / "total buffered duration around the current position"

Default: 0.75

bufferRatioMin?: number

The minimum ratio to buffer ahead of the current position.

Ratio is "buffered duration left to play" / "total buffered duration around the current position"

Default: 0.5

maxNumDecodeFailures?: number

Maximum number of unrecoverable decode failures that can occur before shutting down.

maxNumNetworkFailures?: number

Maximum number of unrecoverable network failures that can occur before shutting down.

probeChunkSizeMaxBytes?: number

Specifies the maximum download chunk size during media probe (reading file metadata before segmentation starts).

Default: 1024 * 1024 * 100 (100 mb)

probeChunkSizeMinBytes?: number

Specifies the minimum download chunk size during media probe (reading file metadata before segmentation starts).

Default: 1024 * 1024 * 2 (2 mb)

quotaExceededKeepWindowSizeSeconds?: number

Specifies the window of time to keep around the current play head position when the browser reports that the memory quota for a source buffer is exceeded.

|--------------------|----c----|-------------------------|

Here "c" is the play head position. All buffered data outside of the window around "c" will be removed to free up memory.

Default: 20

seekLookBehindSeconds?: number

Specifies the number of seconds to buffer before the seek target.

Default: 5

segmentDownloadChunkSizeMaxBytes?: number

Specifies the maximum size of the segmentation download chunk size.

Default: 1024 * 1024 * 10 (10 mb)

segmentDownloadChunkSizeMinBytes?: number

Specifies the minimum size of the segmentation download chunk size.

Default: 1024 * 1024 * 2 (2 mb)

segmentDownloadChunkSizeTargetSeconds?: number

Specifies the number of seconds of media that we want to include per download chunk size. This value (after conversion to bytes) is clamped between segmentChunkSizeMinBytes and segmentChunkSizeMinBytes.

Default: 2

segmentationProcessSamplesSizeSeconds?: number

Specifies the number of seconds to set as target for the segmentation process (mp4 to fmp4). This is a fine-tune setting that you most likely don't want to change.

Default: 10

subtitleCodecTypesImsc?: string[]

Subtitle codecs that will be parsed for TTML/IMSC.

Default: ["metx", "stpp"]

subtitleCodecTypesScc?: string[]

Subtitle codecs that will be parsed for SCC.

Default: ["c608", "c708"]

subtitleCodecTypesVtt?: string[]

Subtitle codecs that will be parsed for VTT.

Default: ["wvtt", "mett", "sbtt", "stxt", "tx3g"]

subtitleExtractionChunkSize?: number

Specifies the chunk size to use for subtitle extraction process. This is a fine-tune setting that you most likely don't want to change.

Default: 1

titleBlockList?: string[]

Track titles will be blocked from being picked.

updateUrl?: ((response) => Promise<string>)

Callback called when a request to the current url fails with a client error. Return the another url you want to retry or return null to skip the retry.

Type declaration

    • (response): Promise<string>
    • Callback called when a request to the current url fails with a client error. Return the another url you want to retry or return null to skip the retry.

      Parameters

      • response: Response

        the failed response

      Returns Promise<string>

Param: response

the failed response

verbose?: boolean | LogLevel

Determines the logging level.

Set to "true" or LogLevel.INFO to enable verbose logging. Set to LogLevel.DEBUG to enable even more verbose logging.

Default: false