public static final class DashMediaSource.Factory
extends java.lang.Object
implements com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory
DashMediaSources.| Constructor and Description |
|---|
Factory(DashChunkSource.Factory chunkSourceFactory,
com.google.android.exoplayer2.upstream.DataSource.Factory manifestDataSourceFactory)
Creates a new factory for
DashMediaSources. |
| Modifier and Type | Method and Description |
|---|---|
DashMediaSource |
createMediaSource(DashManifest manifest,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Returns a new
DashMediaSource using the current parameters and the specified
sideloaded manifest. |
DashMediaSource |
createMediaSource(android.net.Uri manifestUri)
Returns a new
DashMediaSource using the current parameters. |
DashMediaSource |
createMediaSource(android.net.Uri manifestUri,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Returns a new
DashMediaSource using the current parameters. |
int[] |
getSupportedTypes() |
DashMediaSource.Factory |
setCompositeSequenceableLoaderFactory(com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create composite
SequenceableLoaders for when this media source
loads data from multiple streams (video, audio etc...). |
DashMediaSource.Factory |
setLivePresentationDelayMs(long livePresentationDelayMs)
Sets the duration in milliseconds by which the default start position should precede the end
of the live window for live playbacks.
|
DashMediaSource.Factory |
setManifestParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<? extends DashManifest> manifestParser)
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.
|
DashMediaSource.Factory |
setMinLoadableRetryCount(int minLoadableRetryCount)
Sets the minimum number of times to retry if a loading error occurs.
|
public Factory(DashChunkSource.Factory chunkSourceFactory, @Nullable com.google.android.exoplayer2.upstream.DataSource.Factory manifestDataSourceFactory)
DashMediaSources.chunkSourceFactory - A factory for DashChunkSource instances.manifestDataSourceFactory - A factory for DataSource instances that will be used
to load (and refresh) the manifest. May be null if the factory will only ever be
used to create create media sources with sideloaded manifests via createMediaSource(DashManifest, Handler, MediaSourceEventListener).public DashMediaSource.Factory setMinLoadableRetryCount(int minLoadableRetryCount)
DashMediaSource.DEFAULT_MIN_LOADABLE_RETRY_COUNT.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 DashMediaSource.Factory setLivePresentationDelayMs(long livePresentationDelayMs)
DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS.livePresentationDelayMs - For live playbacks, the duration in milliseconds by which the
default start position should precede the end of the live window. Use DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_PREFER_MANIFEST_MS to use the value specified by the
manifest, if present.java.lang.IllegalStateException - If one of the create methods has already been called.public DashMediaSource.Factory setManifestParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<? extends DashManifest> manifestParser)
manifestParser - A parser for loaded manifest data.java.lang.IllegalStateException - If one of the create methods has already been called.public DashMediaSource.Factory setCompositeSequenceableLoaderFactory(com.google.android.exoplayer2.source.CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
SequenceableLoaders for when this media source
loads data from multiple streams (video, audio etc...). The default is an instance of DefaultCompositeSequenceableLoaderFactory.compositeSequenceableLoaderFactory - A factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video,
audio etc...).java.lang.IllegalStateException - If one of the create methods has already been called.public DashMediaSource createMediaSource(DashManifest manifest, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
DashMediaSource using the current parameters and the specified
sideloaded manifest.manifest - The manifest. DashManifest.dynamic must be false.eventHandler - A handler for events.eventListener - A listener of events.DashMediaSource.java.lang.IllegalArgumentException - If DashManifest.dynamic is true.public DashMediaSource createMediaSource(android.net.Uri manifestUri)
DashMediaSource using the current parameters. Media source events will
not be delivered.manifestUri - The manifest Uri.DashMediaSource.public DashMediaSource createMediaSource(android.net.Uri manifestUri, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
DashMediaSource using the current parameters.createMediaSource in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactorymanifestUri - The manifest Uri.eventHandler - A handler for events.eventListener - A listener of events.DashMediaSource.public int[] getSupportedTypes()
getSupportedTypes in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory