docs/doc/reference/com/google/android/exoplayer2/source/dash/DashMediaSource.Factory.html
Package com.google.android.exoplayer2.source.dash
All Implemented Interfaces:MediaSource.Factory, MediaSourceFactoryEnclosing class:DashMediaSource
public static final classDashMediaSource.Factoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[MediaSourceFactory](../MediaSourceFactory.html "interface in com.google.android.exoplayer2.source")
Factory for DashMediaSources.
-
UNSUPPORTED
Constructors | Constructor | Description |
| --- | --- |
| Factory(DashChunkSource.Factory chunkSourceFactory, DataSource.Factory manifestDataSourceFactory) |
Creates a new factory for DashMediaSources.
|
| Factory(DataSource.Factory dataSourceFactory) |
Creates a new factory for DashMediaSources.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| DashMediaSource | createMediaSource(MediaItem mediaItem) |
Returns a new DashMediaSource using the current parameters.
|
| DashMediaSource | createMediaSource(DashManifest manifest) |
Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.
|
| DashMediaSource | createMediaSource(DashManifest manifest, MediaItem mediaItem) |
Returns a new DashMediaSource using the current parameters and the specified sideloaded manifest.
|
| @com.google.android.exoplayer2.C.ContentType int[] | getSupportedTypes() |
Returns the content types supported by media sources created by this factory.
|
| DashMediaSource.Factory | setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory) |
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
|
| 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...).
|
| DashMediaSource.Factory | setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider) |
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
|
| 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.
|
| DashMediaSource.Factory | setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy) |
Sets an optional LoadErrorHandlingPolicy.
|
| DashMediaSource.Factory | setManifestParser(ParsingLoadable.Parser<? extends DashManifest> manifestParser) |
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.
|
| 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.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Factory([DataSource.Factory](../../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")dataSourceFactory)
Creates a new factory for DashMediaSources.
The factory will use the following default components:
- [`DefaultDashChunkSource.Factory`](DefaultDashChunkSource.Factory.html "class in com.google.android.exoplayer2.source.dash")
- [`DefaultDrmSessionManagerProvider`](../../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
- [`DefaultLoadErrorHandlingPolicy`](../../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")
- [`DefaultCompositeSequenceableLoaderFactory`](../DefaultCompositeSequenceableLoaderFactory.html "class in com.google.android.exoplayer2.source")
Parameters:dataSourceFactory - A factory for DataSource instances that will be used to load manifest and media data.
-
public Factory([DashChunkSource.Factory](DashChunkSource.Factory.html "interface in com.google.android.exoplayer2.source.dash")chunkSourceFactory,
@Nullable[DataSource.Factory](../../upstream/DataSource.Factory.html "interface in com.google.android.exoplayer2.upstream")manifestDataSourceFactory)
Creates a new factory for DashMediaSources.
The factory will use the following default components:
- [`DefaultDrmSessionManagerProvider`](../../drm/DefaultDrmSessionManagerProvider.html "class in com.google.android.exoplayer2.drm")
- [`DefaultLoadErrorHandlingPolicy`](../../upstream/DefaultLoadErrorHandlingPolicy.html "class in com.google.android.exoplayer2.upstream")
- [`DefaultCompositeSequenceableLoaderFactory`](../DefaultCompositeSequenceableLoaderFactory.html "class in com.google.android.exoplayer2.source")
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 createMediaSource(DashManifest, MediaItem).
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")setCmcdConfigurationFactory([CmcdConfiguration.Factory](../../upstream/CmcdConfiguration.Factory.html "interface in com.google.android.exoplayer2.upstream")cmcdConfigurationFactory)
Description copied from interface: MediaSource.Factory
Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.
Specified by:setCmcdConfigurationFactory in interface MediaSource.FactoryReturns:This factory, for convenience.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")setDrmSessionManagerProvider([DrmSessionManagerProvider](../../drm/DrmSessionManagerProvider.html "interface in com.google.android.exoplayer2.drm")drmSessionManagerProvider)
Description copied from interface: MediaSource.Factory
Sets the DrmSessionManagerProvider used to obtain a DrmSessionManager for a MediaItem.
Specified by:setDrmSessionManagerProvider in interface MediaSource.FactoryReturns:This factory, for convenience.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")setLoadErrorHandlingPolicy([LoadErrorHandlingPolicy](../../upstream/LoadErrorHandlingPolicy.html "interface in com.google.android.exoplayer2.upstream")loadErrorHandlingPolicy)
Description copied from interface: MediaSource.Factory
Sets an optional LoadErrorHandlingPolicy.
Specified by:setLoadErrorHandlingPolicy in interface MediaSource.FactoryReturns:This factory, for convenience.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")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.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")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.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")setManifestParser(@Nullable[ParsingLoadable.Parser](../../upstream/ParsingLoadable.Parser.html "interface in com.google.android.exoplayer2.upstream")<? extends[DashManifest](manifest/DashManifest.html "class in com.google.android.exoplayer2.source.dash.manifest")> 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.
-
@CanIgnoreReturnValue
public[DashMediaSource.Factory](DashMediaSource.Factory.html "class in com.google.android.exoplayer2.source.dash")setCompositeSequenceableLoaderFactory([CompositeSequenceableLoaderFactory](../CompositeSequenceableLoaderFactory.html "interface in com.google.android.exoplayer2.source")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](DashMediaSource.html "class in com.google.android.exoplayer2.source.dash")createMediaSource([DashManifest](manifest/DashManifest.html "class in com.google.android.exoplayer2.source.dash.manifest")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.Throws:IllegalArgumentException - If DashManifest.dynamic is true.
-
public[DashMediaSource](DashMediaSource.html "class in com.google.android.exoplayer2.source.dash")createMediaSource([DashManifest](manifest/DashManifest.html "class in com.google.android.exoplayer2.source.dash.manifest")manifest,[MediaItem](../../MediaItem.html "class in com.google.android.exoplayer2")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.Throws:IllegalArgumentException - If DashManifest.dynamic is true.
-
public[DashMediaSource](DashMediaSource.html "class in com.google.android.exoplayer2.source.dash")createMediaSource([MediaItem](../../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)
Returns a new DashMediaSource using the current parameters.
Specified by:createMediaSource in interface MediaSource.FactoryParameters:mediaItem - The media item of the dash stream.Returns:The new DashMediaSource.Throws:NullPointerException - if MediaItem.localConfiguration is null.
-
[@ContentType](../../C.ContentType.html "annotation in com.google.android.exoplayer2")public @com.google.android.exoplayer2.C.ContentType int[] getSupportedTypes()
Description copied from interface: MediaSource.Factory
Returns the content types supported by media sources created by this factory.
Specified by:getSupportedTypes in interface MediaSource.Factory