Back to Exoplayer

SsMediaSource.Factory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/smoothstreaming/SsMediaSource.Factory.html

latest15.5 KB
Original Source

Package com.google.android.exoplayer2.source.smoothstreaming

Class SsMediaSource.Factory

  • java.lang.Object

    • com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource.Factory
  • All Implemented Interfaces:MediaSource.Factory, MediaSourceFactoryEnclosing class:SsMediaSource


public static final classSsMediaSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaSourceFactory](../MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")

Factory for SsMediaSource.

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 for SsMediaSources. | | Factory​(DataSource.Factory dataSourceFactory) | Creates a new factory for SsMediaSources. |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | SsMediaSource | createMediaSource​(MediaItem mediaItem) | Returns a new SsMediaSource using the current parameters. | | SsMediaSource | createMediaSource​(SsManifest manifest) | Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest. | | SsMediaSource | createMediaSource​(SsManifest manifest, MediaItem mediaItem) | Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest. | | @com.google.android.exoplayer2.C.ContentType int[] | getSupportedTypes() | Returns the content types supported by media sources created by this factory. | | SsMediaSource.Factory | setCmcdConfigurationFactory​(CmcdConfiguration.Factory cmcdConfigurationFactory) | Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem. | | SsMediaSource.Factory | setCompositeSequenceableLoaderFactory​(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory) | Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.). | | SsMediaSource.Factory | setDrmSessionManagerProvider​(DrmSessionManagerProvider drmSessionManagerProvider) | Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. | | 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 optional LoadErrorHandlingPolicy. | | SsMediaSource.Factory | setManifestParser​(ParsingLoadable.Parser<? extends SsManifest> manifestParser) | Sets the manifest parser to parse loaded manifest data when loading a manifest URI. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

Factory

public Factory​([DataSource.Factory](../../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory)

Creates a new factory for SsMediaSources.

The factory will use the following default components:

  - [`DefaultSsChunkSource.Factory`](DefaultSsChunkSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")
  - [`DefaultDrmSessionManagerProvider`](../../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
  - [`DefaultLoadErrorHandlingPolicy`](../../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")
  - [`DefaultCompositeSequenceableLoaderFactory`](../DefaultCompositeSequenceableLoaderFactory.html "class in com.google.android.exoplayer2.source")

Parameters:dataSourceFactory - A factory for DataSource instances that will be used to load manifest and media data.

- 

Factory

public Factory​([SsChunkSource.Factory](SsChunkSource.Factory.html "interface in com.google.android.exoplayer2.source.smoothstreaming")chunkSourceFactory,
               @Nullable[DataSource.Factory](../../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")manifestDataSourceFactory)

Creates a new factory for SsMediaSources. The factory will use the following default components: - DefaultDrmSessionManagerProvider - DefaultLoadErrorHandlingPolicy - DefaultCompositeSequenceableLoaderFactory

Parameters: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, MediaItem).

Method Detail

- 

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
public[SsMediaSource.Factory](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")setLoadErrorHandlingPolicy​([LoadErrorHandlingPolicy](../../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)

Description copied from interface: MediaSource.Factory

Sets an optional LoadErrorHandlingPolicy. Specified by:setLoadErrorHandlingPolicy in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

setLivePresentationDelayMs

@CanIgnoreReturnValue
public[SsMediaSource.Factory](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")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 is SsMediaSource.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](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")setManifestParser​(@Nullable[ParsingLoadable.Parser](../../upstream/ParsingLoadable.Parser.html "interface in com.google.android.exoplayer2.upstream")<? extends[SsManifest](manifest/SsManifest.html "class in com.google.android.exoplayer2.source.smoothstreaming.manifest")> 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](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")setCompositeSequenceableLoaderFactory​([CompositeSequenceableLoaderFactory](../CompositeSequenceableLoaderFactory.html "interface in com.google.android.exoplayer2.source")compositeSequenceableLoaderFactory)

Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.). Parameters:compositeSequenceableLoaderFactory - A factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).Returns:This factory, for convenience.

- 

setCmcdConfigurationFactory

@CanIgnoreReturnValue
public[SsMediaSource.Factory](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")setCmcdConfigurationFactory​([CmcdConfiguration.Factory](../../upstream/CmcdConfiguration.Factory.html "interface in com.google.android.exoplayer2.upstream")cmcdConfigurationFactory)

Description copied from interface: MediaSource.Factory

Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem. Specified by:setCmcdConfigurationFactory in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

setDrmSessionManagerProvider

@CanIgnoreReturnValue
public[SsMediaSource.Factory](SsMediaSource.Factory.html "class in com.google.android.exoplayer2.source.smoothstreaming")setDrmSessionManagerProvider​([DrmSessionManagerProvider](../../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider)

Description copied from interface: MediaSource.Factory

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem. Specified by:setDrmSessionManagerProvider in interface MediaSource.FactoryReturns:This factory, for convenience.

- 

createMediaSource

public[SsMediaSource](SsMediaSource.html "class in com.google.android.exoplayer2.source.smoothstreaming")createMediaSource​([SsManifest](manifest/SsManifest.html "class in com.google.android.exoplayer2.source.smoothstreaming.manifest")manifest)

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest. Parameters:manifest - The manifest. SsManifest.isLive must be false.Returns:The new SsMediaSource.Throws:IllegalArgumentException - If SsManifest.isLive is true.

- 

createMediaSource

public[SsMediaSource](SsMediaSource.html "class in com.google.android.exoplayer2.source.smoothstreaming")createMediaSource​([SsManifest](manifest/SsManifest.html "class in com.google.android.exoplayer2.source.smoothstreaming.manifest")manifest,[MediaItem](../../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest. Parameters:manifest - The manifest. SsManifest.isLive must be false.mediaItem - The MediaItem to be included in the timeline.Returns:The new SsMediaSource.Throws:IllegalArgumentException - If SsManifest.isLive is true.

- 

createMediaSource

public[SsMediaSource](SsMediaSource.html "class in com.google.android.exoplayer2.source.smoothstreaming")createMediaSource​([MediaItem](../../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Returns a new SsMediaSource using the current parameters. Specified by:createMediaSource in interface MediaSource.FactoryParameters:mediaItem - The MediaItem.Returns:The new SsMediaSource.Throws:NullPointerException - if MediaItem.localConfiguration is null.

- 

getSupportedTypes

[@ContentType](../../C.ContentType.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()

Description copied from interface: MediaSource.Factory

Returns the content types supported by media sources created by this factory. Specified by:getSupportedTypes in interface MediaSource.Factory