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)
Returns a new
DashMediaSource using the current parameters and the specified
sideloaded manifest. |
DashMediaSource |
createMediaSource(DashManifest manifest,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Deprecated.
Use
createMediaSource(DashManifest) and BaseMediaSource.addEventListener(Handler, MediaSourceEventListener) instead. |
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)
Deprecated.
Use
createMediaSource(Uri) and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener) instead. |
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.
|
DashMediaSource.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(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 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.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)
DashMediaSource using the current parameters and the specified
sideloaded manifest.manifest - The manifest. DashManifest.dynamic must be false.DashMediaSource.java.lang.IllegalArgumentException - If DashManifest.dynamic is true.@Deprecated public DashMediaSource createMediaSource(DashManifest manifest, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
createMediaSource(DashManifest) and BaseMediaSource.addEventListener(Handler, MediaSourceEventListener) instead.public DashMediaSource createMediaSource(android.net.Uri manifestUri)
DashMediaSource using the current parameters.createMediaSource in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactorymanifestUri - The manifest Uri.DashMediaSource.@Deprecated public DashMediaSource createMediaSource(android.net.Uri manifestUri, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
createMediaSource(Uri) and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener) instead.public int[] getSupportedTypes()
getSupportedTypes in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory