class SsMediaSource.Factory : MediaSourceFactory


Factory for SsMediaSource.

Summary

Public constructors

Factory(dataSourceFactory: DataSource.Factory!)

Creates a new factory for SsMediaSources.

Factory(
    chunkSourceFactory: SsChunkSource.Factory!,
    manifestDataSourceFactory: DataSource.Factory?
)

Creates a new factory for SsMediaSources.

Public functions

SsMediaSource!

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest.

SsMediaSource!

Returns a new SsMediaSource using the current parameters.

SsMediaSource!
createMediaSource(manifest: SsManifest!, mediaItem: MediaItem!)

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest.

SsMediaSource.Factory!

This function is deprecated.

This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release.

IntArray<Int>!

Returns the content types supported by media sources created by this factory.

SsMediaSource.Factory!

Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.

SsMediaSource.Factory!

Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).

SsMediaSource.Factory!

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.

SsMediaSource.Factory!

Sets the duration in milliseconds by which the default start position should precede the end of the live window for live playbacks.

SsMediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

SsMediaSource.Factory!

Sets the manifest parser to parse loaded manifest data when loading a manifest URI.

SsMediaSource.Factory!

Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.

Public constructors

Factory

Factory(dataSourceFactory: DataSource.Factory!)

Creates a new factory for SsMediaSources.

The factory will use the following default components:

Parameters
dataSourceFactory: DataSource.Factory!

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

Factory

Factory(
    chunkSourceFactory: SsChunkSource.Factory!,
    manifestDataSourceFactory: DataSource.Factory?
)

Creates a new factory for SsMediaSources. The factory will use the following default components:

Parameters
chunkSourceFactory: SsChunkSource.Factory!

A factory for SsChunkSource instances.

manifestDataSourceFactory: DataSource.Factory?

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.

Public functions

createMediaSource

fun createMediaSource(manifest: SsManifest!): SsMediaSource!

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest.

Parameters
manifest: SsManifest!

The manifest. isLive must be false.

Returns
SsMediaSource!

The new SsMediaSource.

createMediaSource

fun createMediaSource(mediaItem: MediaItem!): SsMediaSource!

Returns a new SsMediaSource using the current parameters.

Parameters
mediaItem: MediaItem!

The MediaItem.

Returns
SsMediaSource!

The new SsMediaSource.

createMediaSource

fun createMediaSource(manifest: SsManifest!, mediaItem: MediaItem!): SsMediaSource!

Returns a new SsMediaSource using the current parameters and the specified sideloaded manifest.

Parameters
manifest: SsManifest!

The manifest. isLive must be false.

mediaItem: MediaItem!

The MediaItem to be included in the timeline.

Returns
SsMediaSource!

The new SsMediaSource.

experimentalParseSubtitlesDuringExtraction

@CanIgnoreReturnValue
fun experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
): SsMediaSource.Factory!

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to true (i.e. subtitles will be parsed during extraction).

This method is experimental and will be renamed or removed in a future release.

Parameters
parseSubtitlesDuringExtraction: Boolean

Whether to parse subtitles during extraction or rendering.

Returns
SsMediaSource.Factory!

This factory, for convenience.

getSupportedTypes

@C.ContentType
fun getSupportedTypes(): IntArray<Int>!

Returns the content types supported by media sources created by this factory.

setCmcdConfigurationFactory

@CanIgnoreReturnValue
fun setCmcdConfigurationFactory(
    cmcdConfigurationFactory: CmcdConfiguration.Factory!
): SsMediaSource.Factory!

Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.

Returns
SsMediaSource.Factory!

This factory, for convenience.

setCompositeSequenceableLoaderFactory

@CanIgnoreReturnValue
fun setCompositeSequenceableLoaderFactory(
    compositeSequenceableLoaderFactory: CompositeSequenceableLoaderFactory!
): SsMediaSource.Factory!

Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc.).

Parameters
compositeSequenceableLoaderFactory: CompositeSequenceableLoaderFactory!

A factory to create composite s for when this media source loads data from multiple streams (video, audio etc.).

Returns
SsMediaSource.Factory!

This factory, for convenience.

setDrmSessionManagerProvider

@CanIgnoreReturnValue
fun setDrmSessionManagerProvider(
    drmSessionManagerProvider: DrmSessionManagerProvider!
): SsMediaSource.Factory!

Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.

Returns
SsMediaSource.Factory!

This factory, for convenience.

setLivePresentationDelayMs

@CanIgnoreReturnValue
fun setLivePresentationDelayMs(livePresentationDelayMs: Long): SsMediaSource.Factory!

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 DEFAULT_LIVE_PRESENTATION_DELAY_MS.

Parameters
livePresentationDelayMs: Long

For live playbacks, the duration in milliseconds by which the default start position should precede the end of the live window.

Returns
SsMediaSource.Factory!

This factory, for convenience.

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): SsMediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

Returns
SsMediaSource.Factory!

This factory, for convenience.

setManifestParser

@CanIgnoreReturnValue
fun setManifestParser(manifestParser: ParsingLoadable.Parser<SsManifest!>?): SsMediaSource.Factory!

Sets the manifest parser to parse loaded manifest data when loading a manifest URI.

Parameters
manifestParser: ParsingLoadable.Parser<SsManifest!>?

A parser for loaded manifest data.

Returns
SsMediaSource.Factory!

This factory, for convenience.

setSubtitleParserFactory

@CanIgnoreReturnValue
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): SsMediaSource.Factory!

Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction.

Parameters
subtitleParserFactory: SubtitleParser.Factory!

The SubtitleParser.Factory for parsing subtitles during extraction.

Returns
SsMediaSource.Factory!

This factory, for convenience.