public static final class DashMediaSource.Factory extends Object implements AdsMediaSource.MediaSourceFactory
DashMediaSource
s.Constructor and Description |
---|
Factory(DashChunkSource.Factory chunkSourceFactory,
DataSource.Factory manifestDataSourceFactory)
Creates a new factory for
DashMediaSource s. |
Factory(DataSource.Factory dataSourceFactory)
Creates a new factory for
DashMediaSource s. |
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,
Handler eventHandler,
MediaSourceEventListener eventListener)
Deprecated.
|
DashMediaSource |
createMediaSource(Uri manifestUri)
Returns a new
DashMediaSource using the current parameters. |
DashMediaSource |
createMediaSource(Uri manifestUri,
Handler eventHandler,
MediaSourceEventListener eventListener)
Deprecated.
|
int[] |
getSupportedTypes()
Returns the content types supported by media sources created by this factory.
|
DashMediaSource.Factory |
setCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create composite
SequenceableLoader s 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(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets the
LoadErrorHandlingPolicy . |
DashMediaSource.Factory |
setManifestParser(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(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)
DashMediaSource
s.dataSourceFactory
- A factory for DataSource
instances that will be used to load
manifest and media data.public Factory(DashChunkSource.Factory chunkSourceFactory, @Nullable DataSource.Factory manifestDataSourceFactory)
DashMediaSource
s.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(Object tag)
Timeline
of the source as Timeline.Window.tag
.tag
- A tag for the media source.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.IllegalStateException
- If one of the create
methods has already been called.public DashMediaSource.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
.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.IllegalStateException
- If one of the create
methods has already been called.public DashMediaSource.Factory setManifestParser(ParsingLoadable.Parser<? extends DashManifest> manifestParser)
manifestParser
- A parser for loaded manifest data.IllegalStateException
- If one of the create
methods has already been called.public DashMediaSource.Factory setCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
SequenceableLoader
s 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 SequenceableLoader
s for when this media source loads data from multiple streams (video,
audio etc...).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
.IllegalArgumentException
- If DashManifest.dynamic
is true.@Deprecated public DashMediaSource createMediaSource(DashManifest manifest, @Nullable Handler eventHandler, @Nullable MediaSourceEventListener eventListener)
createMediaSource(DashManifest)
and BaseMediaSource.addEventListener(Handler, MediaSourceEventListener)
instead.public DashMediaSource createMediaSource(Uri manifestUri)
DashMediaSource
using the current parameters.createMediaSource
in interface AdsMediaSource.MediaSourceFactory
manifestUri
- The manifest Uri
.DashMediaSource
.@Deprecated public DashMediaSource createMediaSource(Uri manifestUri, @Nullable Handler eventHandler, @Nullable MediaSourceEventListener eventListener)
createMediaSource(Uri)
and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener)
instead.public int[] getSupportedTypes()
AdsMediaSource.MediaSourceFactory
C.TYPE_DASH
, C.TYPE_SS
, C.TYPE_HLS
or C.TYPE_OTHER
.getSupportedTypes
in interface AdsMediaSource.MediaSourceFactory