ForwardingMediaSourceFactory


@UnstableApi
class ForwardingMediaSourceFactory : MediaSource.Factory


A forwarding MediaSource.Factory that forwards all methods to the underlying implementation.

Summary

Public constructors

Creates a forwarding MediaSource.Factory.

Public functions

MediaSource!

Creates a new MediaSource with the specified MediaItem.

MediaSource.Factory!
experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
)

This function is deprecated.

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

MediaSource.Factory!
experimentalSetCodecsToParseWithinGopSampleDependencies(
    @C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int
)

Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction.

IntArray<Int>!

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

MediaSource.Factory!
setCmcdConfigurationFactory(
    cmcdConfigurationFactory: CmcdConfiguration.Factory!
)

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

MediaSource.Factory!

Sets a supplier for an ReleasableExecutor that is used for loading the media.

MediaSource.Factory!
setDrmSessionManagerProvider(
    drmSessionManagerProvider: DrmSessionManagerProvider!
)

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

MediaSource.Factory!
setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
)

Sets an optional LoadErrorHandlingPolicy.

MediaSource.Factory!

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

Public constructors

ForwardingMediaSourceFactory

ForwardingMediaSourceFactory(factory: MediaSource.Factory!)

Creates a forwarding MediaSource.Factory.

Parameters
factory: MediaSource.Factory!

The MediaSource.Factory to forward to.

Public functions

createMediaSource

fun createMediaSource(mediaItem: MediaItem!): MediaSource!

Creates a new MediaSource with the specified MediaItem.

Parameters
mediaItem: MediaItem!

The media item to play.

Returns
MediaSource!

The new media source.

experimentalParseSubtitlesDuringExtraction

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

This factory, for convenience.

experimentalSetCodecsToParseWithinGopSampleDependencies

fun experimentalSetCodecsToParseWithinGopSampleDependencies(
    @C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int
): MediaSource.Factory!

Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. Defaults to 0 - empty set of codecs.

Having access to additional sample dependency information can speed up seeking. See FLAG_READ_WITHIN_GOP_SAMPLE_DEPENDENCIES.

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

Parameters
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int

The set of codecs for which to parse within GOP sample dependency information.

Returns
MediaSource.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

fun setCmcdConfigurationFactory(
    cmcdConfigurationFactory: CmcdConfiguration.Factory!
): MediaSource.Factory!

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

Returns
MediaSource.Factory!

This factory, for convenience.

setDownloadExecutor

fun setDownloadExecutor(downloadExecutor: Supplier<ReleasableExecutor!>!): MediaSource.Factory!

Sets a supplier for an ReleasableExecutor that is used for loading the media.

Parameters
downloadExecutor: Supplier<ReleasableExecutor!>!

A Supplier that provides an externally managed ReleasableExecutor for downloading and extraction.

Returns
MediaSource.Factory!

This factory, for convenience.

setDrmSessionManagerProvider

fun setDrmSessionManagerProvider(
    drmSessionManagerProvider: DrmSessionManagerProvider!
): MediaSource.Factory!

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

Returns
MediaSource.Factory!

This factory, for convenience.

setLoadErrorHandlingPolicy

fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): MediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

Returns
MediaSource.Factory!

This factory, for convenience.

setSubtitleParserFactory

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

This factory, for convenience.