public final class

SsMediaSource.Factory

extends java.lang.Object

implements MediaSourceFactory

 java.lang.Object

↳androidx.media3.exoplayer.smoothstreaming.SsMediaSource.Factory

Overview

Factory for SsMediaSource.

Summary

Constructors
publicFactory(DataSource.Factory dataSourceFactory)

Creates a new factory for SsMediaSources.

publicFactory(SsChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory)

Creates a new factory for SsMediaSources.

Methods
public SsMediaSourcecreateMediaSource(MediaItem mediaItem)

Returns a new SsMediaSource using the current parameters.

public SsMediaSourcecreateMediaSource(SsManifest manifest)

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

public SsMediaSourcecreateMediaSource(SsManifest manifest, MediaItem mediaItem)

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

public int[]getSupportedTypes()

public SsMediaSource.FactorysetCompositeSequenceableLoaderFactory(CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory)

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

public SsMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public SsMediaSource.FactorysetLivePresentationDelayMs(long livePresentationDelayMs)

Sets the duration in milliseconds by which the default start position should precede the end of the live window for live playbacks.

public SsMediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

Sets the LoadErrorHandlingPolicy.

public SsMediaSource.FactorysetManifestParser(ParsingLoadable.Parser<SsManifest> 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 SsMediaSources.

Parameters:

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

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

Creates a new factory for SsMediaSources.

Parameters:

chunkSourceFactory: A factory for SsChunkSource 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 SsMediaSource.Factory.createMediaSource(SsManifest, MediaItem).

Methods

public SsMediaSource.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 SsMediaSource.Factory setLivePresentationDelayMs(long livePresentationDelayMs)

Sets the duration in milliseconds by which the default start position should precede the end of the live window for live playbacks. The default value is SsMediaSource.DEFAULT_LIVE_PRESENTATION_DELAY_MS.

Parameters:

livePresentationDelayMs: For live playbacks, the duration in milliseconds by which the default start position should precede the end of the live window.

Returns:

This factory, for convenience.

public SsMediaSource.Factory setManifestParser(ParsingLoadable.Parser<SsManifest> 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 SsMediaSource.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 SsMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public SsMediaSource createMediaSource(SsManifest manifest)

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

Parameters:

manifest: The manifest. SsManifest.isLive must be false.

Returns:

The new SsMediaSource.

public SsMediaSource createMediaSource(SsManifest manifest, MediaItem mediaItem)

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

Parameters:

manifest: The manifest. SsManifest.isLive must be false.
mediaItem: The MediaItem to be included in the timeline.

Returns:

The new SsMediaSource.

public SsMediaSource createMediaSource(MediaItem mediaItem)

Returns a new SsMediaSource using the current parameters.

Parameters:

mediaItem: The MediaItem.

Returns:

The new SsMediaSource.

public int[] getSupportedTypes()