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 forSsMediaSources.Factory(DataSource.Factory dataSourceFactory)Creates a new factory forSsMediaSources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SsMediaSourcecreateMediaSource(MediaItem mediaItem)Returns a newSsMediaSourceusing the current parameters.SsMediaSourcecreateMediaSource(SsManifest manifest)Returns a newSsMediaSourceusing the current parameters and the specified sideloaded manifest.SsMediaSourcecreateMediaSource(SsManifest manifest, MediaItem mediaItem)Returns a newSsMediaSourceusing the current parameters and the specified sideloaded manifest.@com.google.android.exoplayer2.C.ContentType int[]getSupportedTypes()Returns thecontent typessupported by media sources created by this factory.SsMediaSource.FactorysetCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)SsMediaSource.FactorysetCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)Sets the factory to create compositeSequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).SsMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)SsMediaSource.FactorysetLivePresentationDelayMs(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.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)Sets an optionalLoadErrorHandlingPolicy.SsMediaSource.FactorysetManifestParser(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 forSsMediaSources.The factory will use the following default components:
- Parameters:
dataSourceFactory- A factory forDataSourceinstances that will be used to load manifest and media data.
-
Factory
public Factory(SsChunkSource.Factory chunkSourceFactory, @Nullable DataSource.Factory manifestDataSourceFactory)
Creates a new factory forSsMediaSources. The factory will use the following default components:- Parameters:
chunkSourceFactory- A factory forSsChunkSourceinstances.manifestDataSourceFactory- A factory forDataSourceinstances that will be used to load (and refresh) the manifest. May benullif 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.FactorySets an optionalLoadErrorHandlingPolicy.- Specified by:
setLoadErrorHandlingPolicyin 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 compositeSequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).- Parameters:
compositeSequenceableLoaderFactory- A factory to create compositeSequenceableLoaders 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:
setCmcdConfigurationFactoryin interfaceMediaSource.Factory- Returns:
- This factory, for convenience.
-
setDrmSessionManagerProvider
@CanIgnoreReturnValue public SsMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)
Description copied from interface:MediaSource.Factory- Specified by:
setDrmSessionManagerProviderin interfaceMediaSource.Factory- Returns:
- This factory, for convenience.
-
createMediaSource
public SsMediaSource createMediaSource(SsManifest manifest)
Returns a newSsMediaSourceusing the current parameters and the specified sideloaded manifest.- Parameters:
manifest- The manifest.SsManifest.isLivemust be false.- Returns:
- The new
SsMediaSource. - Throws:
IllegalArgumentException- IfSsManifest.isLiveis true.
-
createMediaSource
public SsMediaSource createMediaSource(SsManifest manifest, MediaItem mediaItem)
Returns a newSsMediaSourceusing the current parameters and the specified sideloaded manifest.- Parameters:
manifest- The manifest.SsManifest.isLivemust be false.mediaItem- TheMediaItemto be included in the timeline.- Returns:
- The new
SsMediaSource. - Throws:
IllegalArgumentException- IfSsManifest.isLiveis true.
-
createMediaSource
public SsMediaSource createMediaSource(MediaItem mediaItem)
Returns a newSsMediaSourceusing the current parameters.- Specified by:
createMediaSourcein interfaceMediaSource.Factory- Parameters:
mediaItem- TheMediaItem.- Returns:
- The new
SsMediaSource. - Throws:
NullPointerException- ifMediaItem.localConfigurationisnull.
-
getSupportedTypes
@ContentType public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Description copied from interface:MediaSource.FactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSource.Factory
-
-