public final class

DashMediaSource.Factory

extends java.lang.Object

implements MediaSourceFactory

 java.lang.Object

↳androidx.media3.exoplayer.dash.DashMediaSource.Factory

Overview

Factory for DashMediaSources.

Summary

Constructors
publicFactory(DashChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory)

Creates a new factory for DashMediaSources.

publicFactory(DataSource.Factory dataSourceFactory)

Creates a new factory for DashMediaSources.

Methods
public DashMediaSourcecreateMediaSource(DashManifest manifest)

Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.

public DashMediaSourcecreateMediaSource(DashManifest manifest, MediaItem mediaItem)

Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.

public DashMediaSourcecreateMediaSource(MediaItem mediaItem)

Returns a new DashMediaSource using the current parameters.

public DashMediaSource.FactoryexperimentalParseSubtitlesDuringExtraction(boolean parseSubtitlesDuringExtraction)

public int[]getSupportedTypes()

public DashMediaSource.FactorysetCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

public DashMediaSource.FactorysetCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)

Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc...).

public DashMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public DashMediaSource.FactorysetFallbackTargetLiveOffsetMs(long fallbackTargetLiveOffsetMs)

Sets the target offset for live streams that is used if no value is defined in the MediaItem or the manifest.

public DashMediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

public DashMediaSource.FactorysetManifestParser(ParsingLoadable.Parser<DashManifest> manifestParser)

Sets the manifest parser to parse loaded manifest data when loading a manifest URI.

public DashMediaSource.FactorysetMinLiveStartPositionUs(long minLiveStartPositionUs)

Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.

public DashMediaSource.FactorysetSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Factory(DataSource.Factory dataSourceFactory)

Creates a new factory for DashMediaSources.

The factory will use the following default components:

Parameters:

dataSourceFactory: A factory for DataSource instances that will be used to load manifest and media data.

public Factory(DashChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory)

Creates a new factory for DashMediaSources.

The factory will use the following default components:

Parameters:

chunkSourceFactory: A factory for DashChunkSource instances.
manifestDataSourceFactory: A factory for DataSource instances that will be used to load (and refresh) the manifest. May be null if the factory will only ever be used to create media sources with sideloaded manifests via DashMediaSource.Factory.createMediaSource(DashManifest, MediaItem).

Methods

public DashMediaSource.Factory setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

public DashMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public DashMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

public DashMediaSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)

public DashMediaSource.Factory experimentalParseSubtitlesDuringExtraction(boolean parseSubtitlesDuringExtraction)

public DashMediaSource.Factory setFallbackTargetLiveOffsetMs(long fallbackTargetLiveOffsetMs)

Sets the target offset for live streams that is used if no value is defined in the MediaItem or the manifest.

The default value is DashMediaSource.DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS.

Parameters:

fallbackTargetLiveOffsetMs: The fallback live target offset in milliseconds.

Returns:

This factory, for convenience.

public DashMediaSource.Factory setMinLiveStartPositionUs(long minLiveStartPositionUs)

Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.

This value will override any suggested value from the manifest and helps to prevent BehindLiveWindowException issues.

The default value is DashMediaSource.MIN_LIVE_DEFAULT_START_POSITION_US.

Parameters:

minLiveStartPositionUs: The minimum live start position, in microseconds relative to the start of the live window.

Returns:

This factory, for convenience.

public DashMediaSource.Factory setManifestParser(ParsingLoadable.Parser<DashManifest> manifestParser)

Sets the manifest parser to parse loaded manifest data when loading a manifest URI.

Parameters:

manifestParser: A parser for loaded manifest data.

Returns:

This factory, for convenience.

public DashMediaSource.Factory setCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)

Sets the factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc...). The default is an instance of DefaultCompositeSequenceableLoaderFactory.

Parameters:

compositeSequenceableLoaderFactory: A factory to create composite SequenceableLoaders for when this media source loads data from multiple streams (video, audio etc...).

Returns:

This factory, for convenience.

public DashMediaSource createMediaSource(DashManifest manifest)

Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.

Parameters:

manifest: The manifest. DashManifest.dynamic must be false.

Returns:

The new DashMediaSource.

public DashMediaSource createMediaSource(DashManifest manifest, MediaItem mediaItem)

Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.

Parameters:

manifest: The manifest. DashManifest.dynamic must be false.
mediaItem: The MediaItem to be included in the timeline.

Returns:

The new DashMediaSource.

public DashMediaSource createMediaSource(MediaItem mediaItem)

Returns a new DashMediaSource using the current parameters.

Parameters:

mediaItem: The media item of the dash stream.

Returns:

The new DashMediaSource.

public int[] getSupportedTypes()