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)
Returns a new
ExtractorMediaSource using the current parameters. |
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 |
setMinLoadableRetryCount(int minLoadableRetryCount)
Sets the minimum number of times to retry if a loading error occurs.
|
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 setMinLoadableRetryCount(int minLoadableRetryCount)
ExtractorMediaSource.MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA.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 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. Media source events
will not be delivered.uri - The Uri.ExtractorMediaSource.public ExtractorMediaSource createMediaSource(android.net.Uri uri, @Nullable android.os.Handler eventHandler, @Nullable MediaSourceEventListener eventListener)
ExtractorMediaSource using the current parameters.createMediaSource in interface AdsMediaSource.MediaSourceFactoryuri - The Uri.eventHandler - A handler for events.eventListener - A listener of events.ExtractorMediaSource.public int[] getSupportedTypes()
AdsMediaSource.MediaSourceFactoryC.TYPE_DASH, C.TYPE_SS, C.TYPE_HLS or C.TYPE_OTHER.getSupportedTypes in interface AdsMediaSource.MediaSourceFactory