Class ProgressiveMediaSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.source.ProgressiveMediaSource.Factory
-
- All Implemented Interfaces:
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, using the extractors provided byDefaultExtractorsFactory.Factory(DataSource.Factory dataSourceFactory, ExtractorsFactory extractorsFactory)Factory(DataSource.Factory dataSourceFactory, ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory)Creates a new factory forProgressiveMediaSources.
-
Method Summary
-
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.MediaSourceFactory
setStreamKeys
-
-
-
-
Constructor Detail
-
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forProgressiveMediaSources, using the extractors provided byDefaultExtractorsFactory.- Parameters:
dataSourceFactory- A factory forDataSources 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 forProgressiveMediaSources.- Parameters:
dataSourceFactory- A factory forDataSources to read the media.progressiveMediaExtractorFactory- A factory for theProgressiveMediaExtractorto extract media from its container.
-
-
Method Detail
-
setExtractorsFactory
@Deprecated public ProgressiveMediaSource.Factory setExtractorsFactory(@Nullable ExtractorsFactory extractorsFactory)
Deprecated.Pass theExtractorsFactoryviaFactory(DataSource.Factory, ExtractorsFactory). This is necessary so that proguard can treat the default extractors factory as unused.
-
setCustomCacheKey
@Deprecated public ProgressiveMediaSource.Factory setCustomCacheKey(@Nullable String customCacheKey)
Deprecated.UseMediaItem.Builder.setCustomCacheKey(String)andcreateMediaSource(MediaItem)instead.
-
setTag
@Deprecated public ProgressiveMediaSource.Factory setTag(@Nullable Object tag)
Deprecated.UseMediaItem.Builder.setTag(Object)andcreateMediaSource(MediaItem)instead.
-
setLoadErrorHandlingPolicy
public ProgressiveMediaSource.Factory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets theLoadErrorHandlingPolicy. The default value is created by callingDefaultLoadErrorHandlingPolicy().- Specified by:
setLoadErrorHandlingPolicyin interfaceMediaSourceFactory- 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:MediaSourceFactorySets theDrmSessionManagerProviderused to obtain aDrmSessionManagerfor aMediaItem.If not set,
DefaultDrmSessionManagerProvideris used.If set, calls to the following (deprecated) methods are ignored:
- Specified by:
setDrmSessionManagerProviderin interfaceMediaSourceFactory- Returns:
- This factory, for convenience.
-
setDrmSessionManager
@Deprecated public ProgressiveMediaSource.Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager)
Deprecated.Description copied from interface:MediaSourceFactorySets theDrmSessionManagerto use for all media items regardless of theirMediaItem.DrmConfiguration.Calling this with a non-null
drmSessionManageris equivalent to callingsetDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager).- Specified by:
setDrmSessionManagerin interfaceMediaSourceFactory- Parameters:
drmSessionManager- TheDrmSessionManager, ornullto use theDefaultDrmSessionManager.- Returns:
- This factory, for convenience.
-
setDrmHttpDataSourceFactory
@Deprecated public ProgressiveMediaSource.Factory setDrmHttpDataSourceFactory(@Nullable HttpDataSource.Factory drmHttpDataSourceFactory)
Deprecated.Description copied from interface:MediaSourceFactorySets theHttpDataSource.Factoryto be used for creatingHttpMediaDrmCallbacksto execute key and provisioning requests over HTTP.Calls to this method are ignored if either a
DrmSessionManager providerorconcrete DrmSessionManagerare provided.- Specified by:
setDrmHttpDataSourceFactoryin interfaceMediaSourceFactory- Parameters:
drmHttpDataSourceFactory- The HTTP data source factory, ornullto useDefaultHttpDataSource.Factory.- Returns:
- This factory, for convenience.
-
setDrmUserAgent
@Deprecated public ProgressiveMediaSource.Factory setDrmUserAgent(@Nullable String userAgent)
Deprecated.Description copied from interface:MediaSourceFactorySets the optional user agent to be used for DRM requests.Calls to this method are ignored if any of the following are provided:
- Specified by:
setDrmUserAgentin interfaceMediaSourceFactory- Parameters:
userAgent- The user agent to be used for DRM requests, ornullto use the default.- Returns:
- This factory, for convenience.
-
createMediaSource
@Deprecated public ProgressiveMediaSource createMediaSource(Uri uri)
Deprecated.UsecreateMediaSource(MediaItem)instead.- Specified by:
createMediaSourcein interfaceMediaSourceFactory
-
createMediaSource
public ProgressiveMediaSource createMediaSource(MediaItem mediaItem)
Returns a newProgressiveMediaSourceusing the current parameters.- Specified by:
createMediaSourcein interfaceMediaSourceFactory- Parameters:
mediaItem- TheMediaItem.- Returns:
- The new
ProgressiveMediaSource. - Throws:
NullPointerException- ifMediaItem.localConfigurationisnull.
-
getSupportedTypes
public int[] getSupportedTypes()
Description copied from interface:MediaSourceFactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSourceFactory
-
-