ProgressiveMediaSource.Factory

public final class ProgressiveMediaSource.Factory implements MediaSourceFactory


Factory for ProgressiveMediaSources.

Summary

Public constructors

Factory(DataSource.Factory dataSourceFactory)

Creates a new factory for ProgressiveMediaSources.

Factory(
    DataSource.Factory dataSourceFactory,
    ExtractorsFactory extractorsFactory
)

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

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

Creates a new factory for ProgressiveMediaSources.

Factory(
    DataSource.Factory dataSourceFactory,
    ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory,
    DrmSessionManagerProvider drmSessionManagerProvider,
    LoadErrorHandlingPolicy loadErrorHandlingPolicy,
    int continueLoadingCheckIntervalBytes
)

Creates a new factory for ProgressiveMediaSources.

Public methods

ProgressiveMediaSource

Returns a new ProgressiveMediaSource using the current parameters.

int[]

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

ProgressiveMediaSource.Factory
@CanIgnoreReturnValue
setContinueLoadingCheckIntervalBytes(
    int continueLoadingCheckIntervalBytes
)

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

ProgressiveMediaSource.Factory

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

ProgressiveMediaSource.Factory

Sets an optional LoadErrorHandlingPolicy.

Inherited methods

From androidx.media3.exoplayer.source.MediaSource.Factory
MediaSource.Factory
@UnstableApi
experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue).

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 if experimentalParseSubtitlesDuringExtraction is enabled.

Public constructors

Factory

public Factory(DataSource.Factory dataSourceFactory)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters
DataSource.Factory dataSourceFactory

A factory for data sources to read the media.

Factory

public Factory(
    DataSource.Factory dataSourceFactory,
    ExtractorsFactory extractorsFactory
)

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

The factory will use the following default components:

Parameters
DataSource.Factory dataSourceFactory

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

public Factory(
    DataSource.Factory dataSourceFactory,
    ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory
)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters
DataSource.Factory dataSourceFactory

A factory for data sources to read the media.

ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory

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

Factory

public Factory(
    DataSource.Factory dataSourceFactory,
    ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory,
    DrmSessionManagerProvider drmSessionManagerProvider,
    LoadErrorHandlingPolicy loadErrorHandlingPolicy,
    int continueLoadingCheckIntervalBytes
)

Creates a new factory for ProgressiveMediaSources.

Parameters
DataSource.Factory dataSourceFactory

A factory for data sources to read the media.

ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory

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.

int continueLoadingCheckIntervalBytes

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

Public methods

createMediaSource

public ProgressiveMediaSource createMediaSource(MediaItem mediaItem)

Returns a new ProgressiveMediaSource using the current parameters.

Parameters
MediaItem mediaItem

The MediaItem.

getSupportedTypes

@C.ContentType
public int[] getSupportedTypes()

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

setContinueLoadingCheckIntervalBytes

@CanIgnoreReturnValue
public ProgressiveMediaSource.Factory setContinueLoadingCheckIntervalBytes(
    int continueLoadingCheckIntervalBytes
)

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

Parameters
int continueLoadingCheckIntervalBytes

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

Returns
ProgressiveMediaSource.Factory

This factory, for convenience.

setDrmSessionManagerProvider

@CanIgnoreReturnValue
public ProgressiveMediaSource.Factory setDrmSessionManagerProvider(
    DrmSessionManagerProvider drmSessionManagerProvider
)

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

Returns
ProgressiveMediaSource.Factory

This factory, for convenience.

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
public ProgressiveMediaSource.Factory setLoadErrorHandlingPolicy(
    LoadErrorHandlingPolicy loadErrorHandlingPolicy
)

Sets an optional LoadErrorHandlingPolicy.

Returns
ProgressiveMediaSource.Factory

This factory, for convenience.