DashMediaSource.Factory


class DashMediaSource.Factory : MediaSourceFactory


Factory for DashMediaSources.

Summary

Public constructors

Factory(dataSourceFactory: DataSource.Factory!)

Creates a new factory for DashMediaSources.

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

Creates a new factory for DashMediaSources.

Public functions

DashMediaSource!

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

DashMediaSource!

Returns a new DashMediaSource using the current parameters.

DashMediaSource!
createMediaSource(manifest: DashManifest!, mediaItem: MediaItem!)

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

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

DashMediaSource.Factory!

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

DashMediaSource.Factory!

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

DashMediaSource.Factory!

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

DashMediaSource.Factory!

Sets the target offset for live streams that is used if no value is defined in the MediaItem or the manifest.

DashMediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

DashMediaSource.Factory!

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

DashMediaSource.Factory!

Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.

DashMediaSource.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 DashMediaSources.

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: DashChunkSource.Factory!,
    manifestDataSourceFactory: DataSource.Factory?
)

Creates a new factory for DashMediaSources.

The factory will use the following default components:

Parameters
chunkSourceFactory: DashChunkSource.Factory!

A factory for DashChunkSource 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 media sources with sideloaded manifests via createMediaSource.

Public functions

createMediaSource

fun createMediaSource(manifest: DashManifest!): DashMediaSource!

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

Parameters
manifest: DashManifest!

The manifest. dynamic must be false.

Returns
DashMediaSource!

The new DashMediaSource.

createMediaSource

fun createMediaSource(mediaItem: MediaItem!): DashMediaSource!

Returns a new DashMediaSource using the current parameters.

Parameters
mediaItem: MediaItem!

The media item of the dash stream.

Returns
DashMediaSource!

The new DashMediaSource.

createMediaSource

fun createMediaSource(manifest: DashManifest!, mediaItem: MediaItem!): DashMediaSource!

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

Parameters
manifest: DashManifest!

The manifest. dynamic must be false.

mediaItem: MediaItem!

The MediaItem to be included in the timeline.

Returns
DashMediaSource!

The new DashMediaSource.

experimentalParseSubtitlesDuringExtraction

@CanIgnoreReturnValue
fun experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
): DashMediaSource.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
DashMediaSource.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!
): DashMediaSource.Factory!

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

Returns
DashMediaSource.Factory!

This factory, for convenience.

setCompositeSequenceableLoaderFactory

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

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

Parameters
compositeSequenceableLoaderFactory: CompositeSequenceableLoaderFactory!

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

Returns
DashMediaSource.Factory!

This factory, for convenience.

setDrmSessionManagerProvider

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

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

Returns
DashMediaSource.Factory!

This factory, for convenience.

setFallbackTargetLiveOffsetMs

@CanIgnoreReturnValue
fun setFallbackTargetLiveOffsetMs(fallbackTargetLiveOffsetMs: Long): DashMediaSource.Factory!

Sets the target offset for live streams that is used if no value is defined in the MediaItem or the manifest.

The default value is DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS.

Parameters
fallbackTargetLiveOffsetMs: Long

The fallback live target offset in milliseconds.

Returns
DashMediaSource.Factory!

This factory, for convenience.

setLoadErrorHandlingPolicy

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

Sets an optional LoadErrorHandlingPolicy.

Returns
DashMediaSource.Factory!

This factory, for convenience.

setManifestParser

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

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

Parameters
manifestParser: ParsingLoadable.Parser<DashManifest!>?

A parser for loaded manifest data.

Returns
DashMediaSource.Factory!

This factory, for convenience.

setMinLiveStartPositionUs

@CanIgnoreReturnValue
fun setMinLiveStartPositionUs(minLiveStartPositionUs: Long): DashMediaSource.Factory!

Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.

This value will override any suggested value from the manifest and helps to prevent issues.

The default value is MIN_LIVE_DEFAULT_START_POSITION_US.

Parameters
minLiveStartPositionUs: Long

The minimum live start position, in microseconds relative to the start of the live window.

Returns
DashMediaSource.Factory!

This factory, for convenience.

setSubtitleParserFactory

@CanIgnoreReturnValue
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): DashMediaSource.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
DashMediaSource.Factory!

This factory, for convenience.