public final class

ProgressiveMediaSource.Factory

extends java.lang.Object

implements MediaSourceFactory

 java.lang.Object

↳androidx.media3.exoplayer.source.ProgressiveMediaSource.Factory

Overview

Factory for ProgressiveMediaSources.

Summary

Constructors
publicFactory(DataSource.Factory dataSourceFactory)

Creates a new factory for ProgressiveMediaSources.

publicFactory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)

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

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

Creates a new factory for ProgressiveMediaSources.

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

Creates a new factory for ProgressiveMediaSources.

Methods
public ProgressiveMediaSourcecreateMediaSource(MediaItem mediaItem)

Returns a new ProgressiveMediaSource using the current parameters.

public int[]getSupportedTypes()

public ProgressiveMediaSource.FactorysetContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)

Sets the number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(T).

public ProgressiveMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public ProgressiveMediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Factory(DataSource.Factory dataSourceFactory)

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters:

dataSourceFactory: A factory for data sources to read the media.

public Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)

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

The factory will use the following default components:

Parameters:

dataSourceFactory: A factory for data sources to read the media.
extractorsFactory: A factory for the extractors used to extract the media from its container.

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

Creates a new factory for ProgressiveMediaSources.

The factory will use the following default components:

Parameters:

dataSourceFactory: A factory for data sources to read the media.
progressiveMediaExtractorFactory: A factory for the ProgressiveMediaExtractor to extract the media from its container.

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

Creates a new factory for ProgressiveMediaSources.

Parameters:

dataSourceFactory: A factory for data sources to read the media.
progressiveMediaExtractorFactory: A factory for the ProgressiveMediaExtractor to extract media from its container.
drmSessionManagerProvider: A provider to obtain a DrmSessionManager for a MediaItem.
loadErrorHandlingPolicy: A policy to handle load error.
continueLoadingCheckIntervalBytes: The number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(T).

Methods

public ProgressiveMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

public ProgressiveMediaSource.Factory setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)

Sets the number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(T). The default value is ProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES.

Parameters:

continueLoadingCheckIntervalBytes: The number of bytes that should be loaded between each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(T).

Returns:

This factory, for convenience.

public ProgressiveMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public ProgressiveMediaSource createMediaSource(MediaItem mediaItem)

Returns a new ProgressiveMediaSource using the current parameters.

Parameters:

mediaItem: The MediaItem.

Returns:

The new ProgressiveMediaSource.

public int[] getSupportedTypes()