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
)

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

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 if experimentalParseSubtitlesDuringExtraction is enabled.

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

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

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

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

setDrmSessionManagerProvider

@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

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

Sets an optional LoadErrorHandlingPolicy.

Returns
MediaSource.Factory!

This factory, for convenience.