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, using the extractors provided by DefaultExtractorsFactory.

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)

Sets the 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, using the extractors provided by DefaultExtractorsFactory.

Parameters:

dataSourceFactory: A factory for DataSources to read the media.

public Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)

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

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

Creates a new factory for ProgressiveMediaSources.

Parameters:

dataSourceFactory: A factory for DataSources to read the media.
progressiveMediaExtractorFactory: A factory for the ProgressiveMediaExtractor to extract 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 DataSources 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)

Sets the LoadErrorHandlingPolicy. The default value is created by calling DefaultLoadErrorHandlingPolicy.DefaultLoadErrorHandlingPolicy().

Parameters:

loadErrorHandlingPolicy: A LoadErrorHandlingPolicy.

Returns:

This factory, for convenience.

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()