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. |
Factory(com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory)
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)
Deprecated.
|
DashMediaSource.Factory |
setLivePresentationDelayMs(long livePresentationDelayMs,
boolean overridesManifest)
Sets the duration in milliseconds by which the default start position should precede the end
of the live window for live playbacks.
|
DashMediaSource.Factory |
setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets the
LoadErrorHandlingPolicy. |
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)
Deprecated.
Use
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy) instead. |
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(com.google.android.exoplayer2.upstream.DataSource.Factory dataSourceFactory)
DashMediaSources.dataSourceFactory - A factory for DataSource instances that will be used to load
manifest and media data.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.@Deprecated public DashMediaSource.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 DashMediaSource.Factory setLoadErrorHandlingPolicy(com.google.android.exoplayer2.upstream.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.@Deprecated public DashMediaSource.Factory setLivePresentationDelayMs(long livePresentationDelayMs)
setLivePresentationDelayMs(long, boolean).public DashMediaSource.Factory setLivePresentationDelayMs(long livePresentationDelayMs, boolean overridesManifest)
overridesManifest parameter specifies
whether the value is used in preference to one in the manifest, if present. The default value
is DashMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS, and by default overridesManifest is
false.livePresentationDelayMs - For live playbacks, the duration in milliseconds by which the
default start position should precede the end of the live window.overridesManifest - Whether the value is used in preference to one in 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