Class SsMediaSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource.Factory
-
- All Implemented Interfaces:
MediaSource.Factory
,MediaSourceFactory
- Enclosing class:
- SsMediaSource
public static final class SsMediaSource.Factory extends Object implements MediaSourceFactory
Factory forSsMediaSource
.
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.source.MediaSourceFactory
UNSUPPORTED
-
-
Constructor Summary
Constructors Constructor Description Factory(SsChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory)
Creates a new factory forSsMediaSource
s.Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forSsMediaSource
s.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SsMediaSource
createMediaSource(MediaItem mediaItem)
Returns a newSsMediaSource
using the current parameters.SsMediaSource
createMediaSource(SsManifest manifest)
Returns a newSsMediaSource
using the current parameters and the specified sideloaded manifest.SsMediaSource
createMediaSource(SsManifest manifest, MediaItem mediaItem)
Returns a newSsMediaSource
using the current parameters and the specified sideloaded manifest.@com.google.android.exoplayer2.C.ContentType int[]
getSupportedTypes()
Returns thecontent types
supported by media sources created by this factory.SsMediaSource.Factory
setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)
SsMediaSource.Factory
setCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create compositeSequenceableLoader
s for when this media source loads data from multiple streams (video, audio etc.).SsMediaSource.Factory
setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
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
setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets an optionalLoadErrorHandlingPolicy
.SsMediaSource.Factory
setManifestParser(ParsingLoadable.Parser<? extends SsManifest> manifestParser)
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.
-
-
-
Constructor Detail
-
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forSsMediaSource
s.The factory will use the following default components:
- Parameters:
dataSourceFactory
- A factory forDataSource
instances that will be used to load manifest and media data.
-
Factory
public Factory(SsChunkSource.Factory chunkSourceFactory, @Nullable DataSource.Factory manifestDataSourceFactory)
Creates a new factory forSsMediaSource
s. The factory will use the following default components:- Parameters:
chunkSourceFactory
- A factory forSsChunkSource
instances.manifestDataSourceFactory
- A factory forDataSource
instances that will be used to load (and refresh) the manifest. May benull
if the factory will only ever be used to create create media sources with sideloaded manifests viacreateMediaSource(SsManifest, MediaItem)
.
-
-
Method Detail
-
setLoadErrorHandlingPolicy
@CanIgnoreReturnValue public SsMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Description copied from interface:MediaSource.Factory
Sets an optionalLoadErrorHandlingPolicy
.- Specified by:
setLoadErrorHandlingPolicy
in interfaceMediaSource.Factory
- Returns:
- This factory, for convenience.
-
setLivePresentationDelayMs
@CanIgnoreReturnValue public 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. The default value isSsMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS
.- Parameters:
livePresentationDelayMs
- For live playbacks, the duration in milliseconds by which the default start position should precede the end of the live window.- Returns:
- This factory, for convenience.
-
setManifestParser
@CanIgnoreReturnValue public SsMediaSource.Factory setManifestParser(@Nullable ParsingLoadable.Parser<? extends SsManifest> manifestParser)
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.- Parameters:
manifestParser
- A parser for loaded manifest data.- Returns:
- This factory, for convenience.
-
setCompositeSequenceableLoaderFactory
@CanIgnoreReturnValue public SsMediaSource.Factory setCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create compositeSequenceableLoader
s for when this media source loads data from multiple streams (video, audio etc.).- Parameters:
compositeSequenceableLoaderFactory
- A factory to create compositeSequenceableLoader
s for when this media source loads data from multiple streams (video, audio etc.).- Returns:
- This factory, for convenience.
-
setCmcdConfigurationFactory
@CanIgnoreReturnValue public SsMediaSource.Factory setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)
Description copied from interface:MediaSource.Factory
- Specified by:
setCmcdConfigurationFactory
in interfaceMediaSource.Factory
- Returns:
- This factory, for convenience.
-
setDrmSessionManagerProvider
@CanIgnoreReturnValue public SsMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.Factory
- Specified by:
setDrmSessionManagerProvider
in interfaceMediaSource.Factory
- Returns:
- This factory, for convenience.
-
createMediaSource
public SsMediaSource createMediaSource(SsManifest manifest)
Returns a newSsMediaSource
using the current parameters and the specified sideloaded manifest.- Parameters:
manifest
- The manifest.SsManifest.isLive
must be false.- Returns:
- The new
SsMediaSource
. - Throws:
IllegalArgumentException
- IfSsManifest.isLive
is true.
-
createMediaSource
public SsMediaSource createMediaSource(SsManifest manifest, MediaItem mediaItem)
Returns a newSsMediaSource
using the current parameters and the specified sideloaded manifest.- Parameters:
manifest
- The manifest.SsManifest.isLive
must be false.mediaItem
- TheMediaItem
to be included in the timeline.- Returns:
- The new
SsMediaSource
. - Throws:
IllegalArgumentException
- IfSsManifest.isLive
is true.
-
createMediaSource
public SsMediaSource createMediaSource(MediaItem mediaItem)
Returns a newSsMediaSource
using the current parameters.- Specified by:
createMediaSource
in interfaceMediaSource.Factory
- Parameters:
mediaItem
- TheMediaItem
.- Returns:
- The new
SsMediaSource
. - Throws:
NullPointerException
- ifMediaItem.localConfiguration
isnull
.
-
getSupportedTypes
@ContentType public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Description copied from interface:MediaSource.Factory
Returns thecontent types
supported by media sources created by this factory.- Specified by:
getSupportedTypes
in interfaceMediaSource.Factory
-
-