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 SsMediaSource.FactoryexperimentalParseSubtitlesDuringExtraction(boolean parseSubtitlesDuringExtraction)

public int[]getSupportedTypes()

public SsMediaSource.FactorysetCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

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)

public SsMediaSource.FactorysetManifestParser(ParsingLoadable.Parser<SsManifest> manifestParser)

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

public SsMediaSource.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 SsMediaSources.

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(SsChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory)

Creates a new factory for SsMediaSources. The factory will use the following default components:

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)

public SsMediaSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)

public SsMediaSource.Factory experimentalParseSubtitlesDuringExtraction(boolean parseSubtitlesDuringExtraction)

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

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 setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

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