HlsInterstitialsAdsLoader.AdsMediaSourceFactory


class HlsInterstitialsAdsLoader.AdsMediaSourceFactory : MediaSource.Factory


A MediaSource.Factory to create a media source to play HLS streams with interstitials.

Summary

Public constructors

AdsMediaSourceFactory(
    adsLoader: HlsInterstitialsAdsLoader!,
    adViewProvider: AdViewProvider!,
    context: Context!
)

Creates an instance with a .

AdsMediaSourceFactory(
    adsLoader: HlsInterstitialsAdsLoader!,
    adViewProvider: AdViewProvider!,
    mediaSourceFactory: MediaSource.Factory!
)

Creates an instance with a custom MediaSource.Factory.

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.

HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

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

HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

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

AdsMediaSourceFactory

AdsMediaSourceFactory(
    adsLoader: HlsInterstitialsAdsLoader!,
    adViewProvider: AdViewProvider!,
    context: Context!
)

Creates an instance with a .

Parameters
adsLoader: HlsInterstitialsAdsLoader!

The HlsInterstitialsAdsLoader.

adViewProvider: AdViewProvider!

Provider of views for the ad UI.

context: Context!

The Context.

AdsMediaSourceFactory

AdsMediaSourceFactory(
    adsLoader: HlsInterstitialsAdsLoader!,
    adViewProvider: AdViewProvider!,
    mediaSourceFactory: MediaSource.Factory!
)

Creates an instance with a custom MediaSource.Factory.

Parameters
adsLoader: HlsInterstitialsAdsLoader!

The HlsInterstitialsAdsLoader.

adViewProvider: AdViewProvider!

Provider of views for the ad UI.

mediaSourceFactory: MediaSource.Factory!

The MediaSource.Factory used to create content and ad media sources.

Throws
java.lang.IllegalStateException

If the provided media source factory doesn't support content type CONTENT_TYPE_HLS.

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!
): HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

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

Returns
HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

This factory, for convenience.

setLoadErrorHandlingPolicy

@CanIgnoreReturnValue
fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

Sets an optional LoadErrorHandlingPolicy.

Returns
HlsInterstitialsAdsLoader.AdsMediaSourceFactory!

This factory, for convenience.