ExternallyLoadedMediaSource.Factory


public final class ExternallyLoadedMediaSource.Factory implements MediaSource.Factory


Factory for ExternallyLoadedMediaSource.

Summary

Public constructors

Factory(long timelineDurationUs, ExternalLoader externalLoader)

Creates an instance.

Public methods

ExternallyLoadedMediaSource

Creates a new MediaSource with the specified MediaItem.

int[]

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

MediaSource.Factory
setDrmSessionManagerProvider(
    DrmSessionManagerProvider drmSessionManagerProvider
)

Does nothing.

MediaSource.Factory
setLoadErrorHandlingPolicy(
    LoadErrorHandlingPolicy loadErrorHandlingPolicy
)

Does nothing.

Inherited methods

From androidx.media3.exoplayer.source.MediaSource.Factory
MediaSource.Factory
@UnstableApi
experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)

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

public Factory(long timelineDurationUs, ExternalLoader externalLoader)

Creates an instance.

Parameters
long timelineDurationUs

The duration of the SinglePeriodTimeline created, in microseconds.

ExternalLoader externalLoader

The ExternalLoader to load the media in preparation for playback.

Public methods

createMediaSource

public ExternallyLoadedMediaSource createMediaSource(MediaItem mediaItem)

Creates a new MediaSource with the specified MediaItem.

Parameters
MediaItem mediaItem

The media item to play.

getSupportedTypes

@C.ContentType
public int[] getSupportedTypes()

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

setDrmSessionManagerProvider

public MediaSource.Factory setDrmSessionManagerProvider(
    DrmSessionManagerProvider drmSessionManagerProvider
)

Does nothing. ExternallyLoadedMediaSource does not support DRM.

setLoadErrorHandlingPolicy

public MediaSource.Factory setLoadErrorHandlingPolicy(
    LoadErrorHandlingPolicy loadErrorHandlingPolicy
)

Does nothing. ExternallyLoadedMediaSource does not support error handling policies.