Class ProgressiveMediaSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.source.ProgressiveMediaSource.Factory
-
- All Implemented Interfaces:
MediaSource.Factory,MediaSourceFactory
- Enclosing class:
- ProgressiveMediaSource
public static final class ProgressiveMediaSource.Factory extends Object implements MediaSourceFactory
Factory forProgressiveMediaSources.
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.source.MediaSourceFactory
UNSUPPORTED
-
-
Constructor Summary
Constructors Constructor Description Factory(DataSource.Factory dataSourceFactory)Creates a new factory forProgressiveMediaSources.Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory)Creates a new factory forProgressiveMediaSources.Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory, DrmSessionManagerProvider drmSessionManagerProvider, LoadErrorHandlingPolicy loadErrorHandlingPolicy, int continueLoadingCheckIntervalBytes)Creates a new factory forProgressiveMediaSources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgressiveMediaSourcecreateMediaSource(MediaItem mediaItem)Returns a newProgressiveMediaSourceusing the current parameters.@com.google.android.exoplayer2.C.ContentType int[]getSupportedTypes()Returns thecontent typessupported by media sources created by this factory.ProgressiveMediaSource.FactorysetContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)Sets the number of bytes that should be loaded between each invocation ofSequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).ProgressiveMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)ProgressiveMediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)Sets an optionalLoadErrorHandlingPolicy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.source.MediaSource.Factory
setCmcdConfigurationFactory
-
-
-
-
Constructor Detail
-
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forProgressiveMediaSources.The factory will use the following default components:
- Parameters:
dataSourceFactory- A factory for data sources to read the media.
-
Factory
public Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)
Equivalent tonew 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.
-
Factory
public Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory)
Creates a new factory forProgressiveMediaSources.The factory will use the following default components:
- Parameters:
dataSourceFactory- A factory for data sources to read the media.progressiveMediaExtractorFactory- A factory for theProgressiveMediaExtractorto 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 forProgressiveMediaSources.- Parameters:
dataSourceFactory- A factory for data sources to read the media.progressiveMediaExtractorFactory- A factory for theProgressiveMediaExtractorto extract media from its container.drmSessionManagerProvider- A provider to obtain aDrmSessionManagerfor aMediaItem.loadErrorHandlingPolicy- A policy to handle load error.continueLoadingCheckIntervalBytes- The number of bytes that should be loaded between each invocation ofSequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).
-
-
Method Detail
-
setLoadErrorHandlingPolicy
@CanIgnoreReturnValue public ProgressiveMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Description copied from interface:MediaSource.FactorySets an optionalLoadErrorHandlingPolicy.- Specified by:
setLoadErrorHandlingPolicyin interfaceMediaSource.Factory- Returns:
- This factory, for convenience.
-
setContinueLoadingCheckIntervalBytes
@CanIgnoreReturnValue public ProgressiveMediaSource.Factory setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)
Sets the number of bytes that should be loaded between each invocation ofSequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). The default value isProgressiveMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES.- Parameters:
continueLoadingCheckIntervalBytes- The number of bytes that should be loaded between each invocation ofSequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).- Returns:
- This factory, for convenience.
-
setDrmSessionManagerProvider
@CanIgnoreReturnValue public ProgressiveMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.Factory- Specified by:
setDrmSessionManagerProviderin interfaceMediaSource.Factory- Returns:
- This factory, for convenience.
-
createMediaSource
public ProgressiveMediaSource createMediaSource(MediaItem mediaItem)
Returns a newProgressiveMediaSourceusing the current parameters.- Specified by:
createMediaSourcein interfaceMediaSource.Factory- Parameters:
mediaItem- TheMediaItem.- Returns:
- The new
ProgressiveMediaSource. - Throws:
NullPointerException- ifMediaItem.localConfigurationisnull.
-
getSupportedTypes
@ContentType public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Description copied from interface:MediaSource.FactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSource.Factory
-
-