Class SsMediaSource.Factory
- java.lang.Object
-
- com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource.Factory
-
- All Implemented Interfaces:
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 Deprecated Methods Modifier and Type Method Description SsMediaSourcecreateMediaSource(Uri uri)Deprecated.UsecreateMediaSource(MediaItem)instead.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.int[]getSupportedTypes()Returns thecontent typessupported by media sources created by this factory.SsMediaSource.FactorysetCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)Sets the factory to create compositeSequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).SsMediaSource.FactorysetDrmHttpDataSourceFactory(HttpDataSource.Factory drmHttpDataSourceFactory)Deprecated.SsMediaSource.FactorysetDrmSessionManager(DrmSessionManager drmSessionManager)Deprecated.SsMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)SsMediaSource.FactorysetDrmUserAgent(String userAgent)Deprecated.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 theLoadErrorHandlingPolicy.SsMediaSource.FactorysetManifestParser(ParsingLoadable.Parser<? extends SsManifest> manifestParser)Sets the manifest parser to parse loaded manifest data when loading a manifest URI.SsMediaSource.FactorysetStreamKeys(List<StreamKey> streamKeys)Deprecated.UseMediaItem.Builder.setStreamKeys(List)andcreateMediaSource(MediaItem)instead.SsMediaSource.FactorysetTag(Object tag)Deprecated.UseMediaItem.Builder.setTag(Object)andcreateMediaSource(MediaItem)instead.
-
-
-
Constructor Detail
-
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory forSsMediaSources.- 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.- 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
-
setTag
@Deprecated public SsMediaSource.Factory setTag(@Nullable Object tag)
Deprecated.UseMediaItem.Builder.setTag(Object)andcreateMediaSource(MediaItem)instead.
-
setLoadErrorHandlingPolicy
public SsMediaSource.Factory setLoadErrorHandlingPolicy(@Nullable LoadErrorHandlingPolicy loadErrorHandlingPolicy)
Sets theLoadErrorHandlingPolicy. The default value is created by callingDefaultLoadErrorHandlingPolicy().- Specified by:
setLoadErrorHandlingPolicyin interfaceMediaSourceFactory- 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 compositeSequenceableLoaders 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 compositeSequenceableLoaders 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:MediaSourceFactorySets theDrmSessionManagerProviderused to obtain aDrmSessionManagerfor aMediaItem.If not set,
DefaultDrmSessionManagerProvideris used.If set, calls to the following (deprecated) methods are ignored:
- Specified by:
setDrmSessionManagerProviderin interfaceMediaSourceFactory- Returns:
- This factory, for convenience.
-
setDrmSessionManager
@Deprecated public SsMediaSource.Factory setDrmSessionManager(@Nullable DrmSessionManager drmSessionManager)
Deprecated.Description copied from interface:MediaSourceFactorySets theDrmSessionManagerto use for all media items regardless of theirMediaItem.DrmConfiguration.Calling this with a non-null
drmSessionManageris equivalent to callingsetDrmSessionManagerProvider(unusedMediaItem -> drmSessionManager).- Specified by:
setDrmSessionManagerin interfaceMediaSourceFactory- Parameters:
drmSessionManager- TheDrmSessionManager, ornullto use theDefaultDrmSessionManager.- Returns:
- This factory, for convenience.
-
setDrmHttpDataSourceFactory
@Deprecated public SsMediaSource.Factory setDrmHttpDataSourceFactory(@Nullable HttpDataSource.Factory drmHttpDataSourceFactory)
Deprecated.Description copied from interface:MediaSourceFactorySets theHttpDataSource.Factoryto be used for creatingHttpMediaDrmCallbacksto execute key and provisioning requests over HTTP.Calls to this method are ignored if either a
DrmSessionManager providerorconcrete DrmSessionManagerare provided.- Specified by:
setDrmHttpDataSourceFactoryin interfaceMediaSourceFactory- Parameters:
drmHttpDataSourceFactory- The HTTP data source factory, ornullto useDefaultHttpDataSource.Factory.- Returns:
- This factory, for convenience.
-
setDrmUserAgent
@Deprecated public SsMediaSource.Factory setDrmUserAgent(@Nullable String userAgent)
Deprecated.Description copied from interface:MediaSourceFactorySets the optional user agent to be used for DRM requests.Calls to this method are ignored if any of the following are provided:
- Specified by:
setDrmUserAgentin interfaceMediaSourceFactory- Parameters:
userAgent- The user agent to be used for DRM requests, ornullto use the default.- Returns:
- This factory, for convenience.
-
setStreamKeys
@Deprecated public SsMediaSource.Factory setStreamKeys(@Nullable List<StreamKey> streamKeys)
Deprecated.UseMediaItem.Builder.setStreamKeys(List)andcreateMediaSource(MediaItem)instead.- Specified by:
setStreamKeysin interfaceMediaSourceFactory
-
createMediaSource
@Deprecated public SsMediaSource createMediaSource(Uri uri)
Deprecated.UsecreateMediaSource(MediaItem)instead.- Specified by:
createMediaSourcein interfaceMediaSourceFactory
-
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 interfaceMediaSourceFactory- Parameters:
mediaItem- TheMediaItem.- Returns:
- The new
SsMediaSource. - Throws:
NullPointerException- ifMediaItem.localConfigurationisnull.
-
getSupportedTypes
public int[] getSupportedTypes()
Description copied from interface:MediaSourceFactoryReturns thecontent typessupported by media sources created by this factory.- Specified by:
getSupportedTypesin interfaceMediaSourceFactory
-
-