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.int[]
getSupportedTypes()
Returns thecontent types
supported by media sources created by this factory.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 theLoadErrorHandlingPolicy
.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.- 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.- 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
public SsMediaSource.Factory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets theLoadErrorHandlingPolicy
. The default value is created by callingDefaultLoadErrorHandlingPolicy()
.- Specified by:
setLoadErrorHandlingPolicy
in interfaceMediaSource.Factory
- Parameters:
loadErrorHandlingPolicy
- ALoadErrorHandlingPolicy
.- Returns:
- This factory, for convenience.
-
setLivePresentationDelayMs
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
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
public SsMediaSource.Factory setCompositeSequenceableLoaderFactory(@Nullable CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)
Sets the factory to create compositeSequenceableLoader
s for when this media source loads data from multiple streams (video, audio etc.). The default is an instance ofDefaultCompositeSequenceableLoaderFactory
.- 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.
-
setDrmSessionManagerProvider
public SsMediaSource.Factory setDrmSessionManagerProvider(@Nullable DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.Factory
Sets theDrmSessionManagerProvider
used to obtain aDrmSessionManager
for aMediaItem
.If not set,
DefaultDrmSessionManagerProvider
is used.- 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
public 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
-
-