public static final class SsMediaSource.Factory
extends java.lang.Object
implements com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactory
SsMediaSource.| Constructor and Description |
|---|
Factory(SsChunkSource.Factory chunkSourceFactory,
com.google.android.exoplayer2.upstream.DataSource.Factory manifestDataSourceFactory)
Creates a new factory for
SsMediaSources. |
| Modifier and Type | Method and Description |
|---|---|
SsMediaSource |
createMediaSource(SsManifest manifest)
Returns a new
SsMediaSource using the current parameters and the specified sideloaded
manifest. |
SsMediaSource |
createMediaSource(SsManifest manifest,
android.os.Handler eventHandler,
com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
Deprecated.
Use
createMediaSource(SsManifest) and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener) instead. |
SsMediaSource |
createMediaSource(android.net.Uri manifestUri)
Returns a new
SsMediaSource using the current parameters. |
SsMediaSource |
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() |
SsMediaSource.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.). |
SsMediaSource.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.
|
SsMediaSource.Factory |
setManifestParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<? extends SsManifest> manifestParser)
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.
|
SsMediaSource.Factory |
setMinLoadableRetryCount(int minLoadableRetryCount)
Sets the minimum number of times to retry if a loading error occurs.
|
SsMediaSource.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(SsChunkSource.Factory chunkSourceFactory, @Nullable com.google.android.exoplayer2.upstream.DataSource.Factory manifestDataSourceFactory)
SsMediaSources.chunkSourceFactory - A factory for SsChunkSource 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(SsManifest, Handler, MediaSourceEventListener).public SsMediaSource.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 SsMediaSource.Factory setMinLoadableRetryCount(int minLoadableRetryCount)
SsMediaSource.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 SsMediaSource.Factory setLivePresentationDelayMs(long livePresentationDelayMs)
SsMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS.livePresentationDelayMs - For live playbacks, the duration in milliseconds by which the
default start position should precede the end of the live window.java.lang.IllegalStateException - If one of the create methods has already been called.public SsMediaSource.Factory setManifestParser(com.google.android.exoplayer2.upstream.ParsingLoadable.Parser<? extends SsManifest> manifestParser)
manifestParser - A parser for loaded manifest data.java.lang.IllegalStateException - If one of the create methods has already been called.public SsMediaSource.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 SsMediaSource createMediaSource(SsManifest manifest)
SsMediaSource using the current parameters and the specified sideloaded
manifest.manifest - The manifest. SsManifest.isLive must be false.SsMediaSource.java.lang.IllegalArgumentException - If SsManifest.isLive is true.@Deprecated public SsMediaSource createMediaSource(SsManifest manifest, @Nullable android.os.Handler eventHandler, @Nullable com.google.android.exoplayer2.source.MediaSourceEventListener eventListener)
createMediaSource(SsManifest) and BaseMediaSource.addEventListener(Handler,
MediaSourceEventListener) instead.public SsMediaSource createMediaSource(android.net.Uri manifestUri)
SsMediaSource using the current parameters.createMediaSource in interface com.google.android.exoplayer2.source.ads.AdsMediaSource.MediaSourceFactorymanifestUri - The manifest Uri.SsMediaSource.@Deprecated public SsMediaSource 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