ProgressiveMediaSource.Factory


class ProgressiveMediaSource.Factory : MediaSourceFactory


Factory for ProgressiveMediaSources.

Summary

Public constructors

Factory(dataSourceFactory: DataSource.Factory!)

Creates a new factory for ProgressiveMediaSources.

Factory(
    dataSourceFactory: DataSource.Factory!,
    extractorsFactory: ExtractorsFactory!
)

Equivalent to new Factory(dataSourceFactory, () -> new BundledExtractorsAdapter(extractorsFactory).

Factory(
    dataSourceFactory: DataSource.Factory!,
    progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!
)

Creates a new factory for ProgressiveMediaSources.

Factory(
    dataSourceFactory: DataSource.Factory!,
    progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!,
    drmSessionManagerProvider: DrmSessionManagerProvider!,
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!,
    continueLoadingCheckIntervalBytes: Int
)

Creates a new factory for ProgressiveMediaSources.

Public functions

ProgressiveMediaSource!

Returns a new ProgressiveMediaSource using the current parameters.

IntArray<Int>!

Returns the content types supported by media sources created by this factory.

ProgressiveMediaSource.Factory!
@CanIgnoreReturnValue
setContinueLoadingCheckIntervalBytes(
    continueLoadingCheckIntervalBytes: Int
)

Sets the number of bytes that should be loaded between each invocation of onContinueLoadingRequested.

ProgressiveMediaSource.Factory!
@CanIgnoreReturnValue
<T : Executor?> setDownloadExecutor(
    downloadExecutor: Supplier<T!>!,
    downloadExecutorReleaser: Consumer<T!>!
)

Sets a supplier for an Executor that is used for loading the media.

ProgressiveMediaSource.Factory!

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.

ProgressiveMediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

ProgressiveMediaSource.Factory!

Allow MediaPeriod preparation to complete despite an error that would have otherwise blocked it.

Inherited functions

From androidx.media3.exoplayer.source.MediaSource.Factory
MediaSource.Factory!
@UnstableApi
experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
)

This function is deprecated.

This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release.

MediaSource.Factory!

Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.

MediaSource.Factory!

Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.

Public constructors

Factory

Factory(dataSourceFactory: DataSource.Factory!)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters
dataSourceFactory: DataSource.Factory!

A factory for data sources to read the media.

Factory

Factory(
    dataSourceFactory: DataSource.Factory!,
    extractorsFactory: ExtractorsFactory!
)

Equivalent to new Factory(dataSourceFactory, () -> new BundledExtractorsAdapter(extractorsFactory).

The factory will use the following default components:

Parameters
dataSourceFactory: DataSource.Factory!

A factory for data sources to read the media.

extractorsFactory: ExtractorsFactory!

A factory for the extractors used to extract the media from its container.

Factory

Factory(
    dataSourceFactory: DataSource.Factory!,
    progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!
)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters
dataSourceFactory: DataSource.Factory!

A factory for data sources to read the media.

progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!

A factory for the ProgressiveMediaExtractor to extract the media from its container.

Factory

Factory(
    dataSourceFactory: DataSource.Factory!,
    progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!,
    drmSessionManagerProvider: DrmSessionManagerProvider!,
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!,
    continueLoadingCheckIntervalBytes: Int
)

Creates a new factory for ProgressiveMediaSources.

Parameters
dataSourceFactory: DataSource.Factory!

A factory for data sources to read the media.

progressiveMediaExtractorFactory: ProgressiveMediaExtractor.Factory!

A factory for the ProgressiveMediaExtractor to extract media from its container.

drmSessionManagerProvider: DrmSessionManagerProvider!

A provider to obtain a DrmSessionManager for a MediaItem.

loadErrorHandlingPolicy: LoadErrorHandlingPolicy!

A policy to handle load error.

continueLoadingCheckIntervalBytes: Int

The number of bytes that should be loaded between each invocation of onContinueLoadingRequested.

Public functions

createMediaSource

fun createMediaSource(mediaItem: MediaItem!): ProgressiveMediaSource!

Returns a new ProgressiveMediaSource using the current parameters.

Parameters
mediaItem: MediaItem!

The MediaItem.

getSupportedTypes

@C.ContentType
fun getSupportedTypes(): IntArray<Int>!

Returns the content types supported by media sources created by this factory.

setContinueLoadingCheckIntervalBytes

@CanIgnoreReturnValue
fun setContinueLoadingCheckIntervalBytes(
    continueLoadingCheckIntervalBytes: Int
): ProgressiveMediaSource.Factory!

Sets the number of bytes that should be loaded between each invocation of onContinueLoadingRequested. The default value is DEFAULT_LOADING_CHECK_INTERVAL_BYTES.

Parameters
continueLoadingCheckIntervalBytes: Int

The number of bytes that should be loaded between each invocation of onContinueLoadingRequested.

Returns
ProgressiveMediaSource.Factory!

This factory, for convenience.

setDownloadExecutor

@CanIgnoreReturnValue
fun <T : Executor?> setDownloadExecutor(
    downloadExecutor: Supplier<T!>!,
    downloadExecutorReleaser: Consumer<T!>!
): ProgressiveMediaSource.Factory!

Sets a supplier for an Executor that is used for loading the media.

Parameters
downloadExecutor: Supplier<T!>!

A Supplier that provides an externally managed for downloading and extraction.

downloadExecutorReleaser: Consumer<T!>!

A callback triggered once a load task is finished and a supplied executor is no longer required.

Returns
ProgressiveMediaSource.Factory!

This factory, for convenience.

setDrmSessionManagerProvider

@CanIgnoreReturnValue
fun setDrmSessionManagerProvider(
    drmSessionManagerProvider: DrmSessionManagerProvider!
): ProgressiveMediaSource.Factory!

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.

Returns
ProgressiveMediaSource.Factory!

This factory, for convenience.

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): ProgressiveMediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

Returns
ProgressiveMediaSource.Factory!

This factory, for convenience.

setSuppressPrepareError

@CanIgnoreReturnValue
fun setSuppressPrepareError(suppressPrepareError: Boolean): ProgressiveMediaSource.Factory!

Allow MediaPeriod preparation to complete despite an error that would have otherwise blocked it.

If set to true, an error that would normally be thrown from maybeThrowPrepareError (e.g. a open error like HTTP 404) is instead suppressed and preparation is completed with no tracks.