public static final class ExtractorMediaSource.Factory extends java.lang.Object implements AdsMediaSource.MediaSourceFactory
ExtractorMediaSources.| Constructor and Description |
|---|
Factory(DataSource.Factory dataSourceFactory)
Creates a new factory for
ExtractorMediaSources. |
| Modifier and Type | Method and Description |
|---|---|
ExtractorMediaSource |
createMediaSource(android.net.Uri uri)
Returns a new
ExtractorMediaSource using the current parameters. |
ExtractorMediaSource |
createMediaSource(android.net.Uri uri,
android.os.Handler eventHandler,
MediaSourceEventListener eventListener)
Deprecated.
|
int[] |
getSupportedTypes()
Returns the content types supported by media sources created by this factory.
|
ExtractorMediaSource.Factory |
setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)
Sets the number of bytes that should be loaded between each invocation of
SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). |
ExtractorMediaSource.Factory |
setCustomCacheKey(java.lang.String customCacheKey)
Sets the custom key that uniquely identifies the original stream.
|
ExtractorMediaSource.Factory |
setExtractorsFactory(ExtractorsFactory extractorsFactory)
Sets the factory for
Extractors to process the media stream. |
ExtractorMediaSource.Factory |
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets the
LoadErrorHandlingPolicy. |
ExtractorMediaSource.Factory |
setMinLoadableRetryCount(int minLoadableRetryCount)
Deprecated.
Use
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy) instead. |
ExtractorMediaSource.Factory |
setTag(java.lang.Object tag)
Sets a tag for the media source which will be published in the
Timeline of the source as Timeline.Window.tag. |
public Factory(DataSource.Factory dataSourceFactory)
ExtractorMediaSources.dataSourceFactory - A factory for DataSources to read the media.public ExtractorMediaSource.Factory setExtractorsFactory(ExtractorsFactory extractorsFactory)
Extractors to process the media stream. The default value is an
instance of DefaultExtractorsFactory.extractorsFactory - A factory for Extractors to process the media stream. If the
possible formats are known, pass a factory that instantiates extractors for those
formats.java.lang.IllegalStateException - If one of the create methods has already been called.public ExtractorMediaSource.Factory setCustomCacheKey(java.lang.String customCacheKey)
null.customCacheKey - A custom key that uniquely identifies the original stream. Used for
cache indexing.java.lang.IllegalStateException - If one of the create methods has already been called.public ExtractorMediaSource.Factory setTag(java.lang.Object tag)
Timeline of the source as Timeline.Window.tag.tag - A tag for the media source.java.lang.IllegalStateException - If one of the create methods has already been called.@Deprecated public ExtractorMediaSource.Factory setMinLoadableRetryCount(int minLoadableRetryCount)
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy) instead.setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy) for the default value.
Calling this method is equivalent to calling setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy) with
DefaultLoadErrorHandlingPolicy(minLoadableRetryCount)
minLoadableRetryCount - The minimum number of times to retry if a loading error occurs.java.lang.IllegalStateException - If one of the create methods has already been called.public ExtractorMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
LoadErrorHandlingPolicy. The default value is created by calling DefaultLoadErrorHandlingPolicy.DefaultLoadErrorHandlingPolicy().
Calling this method overrides any calls to setMinLoadableRetryCount(int).
loadErrorHandlingPolicy - A LoadErrorHandlingPolicy.java.lang.IllegalStateException - If one of the create methods has already been called.public ExtractorMediaSource.Factory setContinueLoadingCheckIntervalBytes(int continueLoadingCheckIntervalBytes)
SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader). The default value is
ExtractorMediaSource.DEFAULT_LOADING_CHECK_INTERVAL_BYTES.continueLoadingCheckIntervalBytes - The number of bytes that should be loaded between
each invocation of SequenceableLoader.Callback.onContinueLoadingRequested(SequenceableLoader).java.lang.IllegalStateException - If one of the create methods has already been called.public ExtractorMediaSource createMediaSource(android.net.Uri uri)
ExtractorMediaSource using the current parameters.createMediaSource in interface AdsMediaSource.MediaSourceFactoryuri - The Uri.ExtractorMediaSource.@Deprecated public ExtractorMediaSource createMediaSource(android.net.Uri uri, @Nullable android.os.Handler eventHandler, @Nullable MediaSourceEventListener eventListener)
createMediaSource(Uri) and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener) instead.public int[] getSupportedTypes()
AdsMediaSource.MediaSourceFactoryC.TYPE_DASH, C.TYPE_SS, C.TYPE_HLS or C.TYPE_OTHER.getSupportedTypes in interface AdsMediaSource.MediaSourceFactory