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 forProgressiveMediaSource
s.
-
-
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 forProgressiveMediaSource
s, using the extractors provided byDefaultExtractorsFactory
.Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)
Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory)
Creates a new factory forProgressiveMediaSource
s.Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory, DrmSessionManagerProvider drmSessionManagerProvider, LoadErrorHandlingPolicy loadErrorHandlingPolicy, int continueLoadingCheckIntervalBytes)
Creates a new factory forProgressiveMediaSource
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgressiveMediaSource
createMediaSource(MediaItem mediaItem)
Returns a newProgressiveMediaSource
using the current parameters.int[]
getSupportedTypes()
Returns thecontent types
supported by media sources created by this factory.ProgressiveMediaSource.Factory
setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)
Sets the number of bytes that should be loaded between each invocation ofSequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader)
.ProgressiveMediaSource.Factory
setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
ProgressiveMediaSource.Factory
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets theLoadErrorHandlingPolicy
.
-
-
-
Constructor Detail
-
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forProgressiveMediaSource
s, using the extractors provided byDefaultExtractorsFactory
.- Parameters:
dataSourceFactory
- A factory forDataSource
s to read the media.
-
Factory
public Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)
-
Factory
public Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory)
Creates a new factory forProgressiveMediaSource
s.- Parameters:
dataSourceFactory
- A factory forDataSource
s to read the media.progressiveMediaExtractorFactory
- A factory for theProgressiveMediaExtractor
to extract media from its container.
-
Factory
public Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory, DrmSessionManagerProvider drmSessionManagerProvider, LoadErrorHandlingPolicy loadErrorHandlingPolicy, int continueLoadingCheckIntervalBytes)
Creates a new factory forProgressiveMediaSource
s.- Parameters:
dataSourceFactory
- A factory forDataSource
s to read the media.progressiveMediaExtractorFactory
- A factory for theProgressiveMediaExtractor
to extract media from its container.drmSessionManagerProvider
- A provider to obtain aDrmSessionManager
for 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
public ProgressiveMediaSource.Factory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets theLoadErrorHandlingPolicy
. The default value is created by callingDefaultLoadErrorHandlingPolicy()
.- Specified by:
setLoadErrorHandlingPolicy
in interfaceMediaSource.Factory
- Parameters:
loadErrorHandlingPolicy
- ALoadErrorHandlingPolicy
.- Returns:
- This factory, for convenience.
-
setContinueLoadingCheckIntervalBytes
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
public ProgressiveMediaSource.Factory setDrmSessionManagerProvider(@Nullable DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.Factory
Sets theDrmSessionManagerProvider
used to obtain aDrmSessionManager
for aMediaItem
.If not set,
DefaultDrmSessionManagerProvider
is used.- Specified by:
setDrmSessionManagerProvider
in interfaceMediaSource.Factory
- Returns:
- This factory, for convenience.
-
createMediaSource
public ProgressiveMediaSource createMediaSource(MediaItem mediaItem)
Returns a newProgressiveMediaSource
using the current parameters.- Specified by:
createMediaSource
in interfaceMediaSource.Factory
- Parameters:
mediaItem
- TheMediaItem
.- Returns:
- The new
ProgressiveMediaSource
. - Throws:
NullPointerException
- ifMediaItem.localConfiguration
isnull
.
-
getSupportedTypes
public int[] getSupportedTypes()
Description copied from interface:MediaSource.Factory
Returns thecontent types
supported by media sources created by this factory.- Specified by:
getSupportedTypes
in interfaceMediaSource.Factory
-
-