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 int[]getSupportedTypes()

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)

Sets the LoadErrorHandlingPolicy.

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

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

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.

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.

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 create media sources with sideloaded manifests via DashMediaSource.Factory.createMediaSource(DashManifest, MediaItem).

Methods

public DashMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public DashMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

Sets the LoadErrorHandlingPolicy. The default value is created by calling DefaultLoadErrorHandlingPolicy.DefaultLoadErrorHandlingPolicy().

Parameters:

loadErrorHandlingPolicy: A LoadErrorHandlingPolicy.

Returns:

This factory, for convenience.

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