ImaServerSideAdInsertionMediaSource.Factory


class ImaServerSideAdInsertionMediaSource.Factory : MediaSource.Factory


Factory for creating ImaServerSideAdInsertionMediaSources.

Apps can use the ImaServerSideAdInsertionMediaSource.Factory to customized the DefaultMediaSourceFactory that is used to build a player:

Summary

Public constructors

Factory(
    adsLoader: ImaServerSideAdInsertionMediaSource.AdsLoader!,
    contentMediaSourceFactory: MediaSource.Factory!
)

Creates a new factory for ImaServerSideAdInsertionMediaSources.

Public functions

MediaSource!

Creates a new MediaSource with the specified MediaItem.

IntArray<Int>!

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

MediaSource.Factory!

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

MediaSource.Factory!

Sets an optional LoadErrorHandlingPolicy.

Inherited functions

From androidx.media3.exoplayer.source.MediaSource.Factory
MediaSource.Factory!
@UnstableApi
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!

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

MediaSource.Factory!

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

Public constructors

Factory

Factory(
    adsLoader: ImaServerSideAdInsertionMediaSource.AdsLoader!,
    contentMediaSourceFactory: MediaSource.Factory!
)

Creates a new factory for ImaServerSideAdInsertionMediaSources.

Parameters
adsLoader: ImaServerSideAdInsertionMediaSource.AdsLoader!

The AdsLoader.

contentMediaSourceFactory: MediaSource.Factory!

The content media source factory to create content sources.

Public functions

createMediaSource

@UnstableApi
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.

getSupportedTypes

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

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

setDrmSessionManagerProvider

@UnstableApi
@CanIgnoreReturnValue
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

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

Sets an optional LoadErrorHandlingPolicy.

Returns
MediaSource.Factory!

This factory, for convenience.