# ForwardingMediaSourceFactory

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/source/ForwardingMediaSourceFactory.java+class:androidx.media3.exoplayer.source.ForwardingMediaSourceFactory)

*** ** * ** ***


```
@UnstableApi
class ForwardingMediaSourceFactory : MediaSource.Factory
```

<br />

*** ** * ** ***

A forwarding `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory` that forwards all methods to the underlying implementation.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#ForwardingMediaSourceFactory(androidx.media3.exoplayer.source.MediaSource.Factory)(factory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!)` Creates a forwarding `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#createMediaSource(androidx.media3.common.MediaItem)(mediaItem: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!)` Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` with the specified `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#experimentalParseSubtitlesDuringExtraction(boolean)( parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` **This function is deprecated.** This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. <br /> |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` | `@https://developer.android.com/reference/kotlin/androidx/media3/common/C.ContentType https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#getSupportedTypes()()` Returns the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.ContentType` supported by media sources created by this factory. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#setCmcdConfigurationFactory(androidx.media3.exoplayer.upstream.CmcdConfiguration.Factory)( cmcdConfigurationFactory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration.Factory! )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration.Factory` used to obtain a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration` for a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#setDownloadExecutor(com.google.common.base.Supplier<androidx.media3.exoplayer.util.ReleasableExecutor>)(downloadExecutor: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>!)` Sets a supplier for an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor` that is used for loading the media. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#setDrmSessionManagerProvider(androidx.media3.exoplayer.drm.DrmSessionManagerProvider)( drmSessionManagerProvider: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionManagerProvider! )` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionManagerProvider` used to obtain a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionManager` for a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#setLoadErrorHandlingPolicy(androidx.media3.exoplayer.upstream.LoadErrorHandlingPolicy)( loadErrorHandlingPolicy: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy! )` Sets an optional `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy`. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/ForwardingMediaSourceFactory#setSubtitleParserFactory(androidx.media3.extractor.text.SubtitleParser.Factory)(subtitleParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory!)` Sets the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` to be used for parsing subtitles during extraction. |

### Inherited Constants

From [androidx.media3.exoplayer.source.MediaSource.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory) `const https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` `@https://developer.android.com/reference/kotlin/androidx/media3/common/util/UnstableApi
https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory#UNSUPPORTED()`

An instance that throws `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` from `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory#createMediaSource(androidx.media3.common.MediaItem)` and `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory#getSupportedTypes()`.

## Public constructors

### ForwardingMediaSourceFactory

```
ForwardingMediaSourceFactory(factory: MediaSource.Factory!)
```

Creates a forwarding `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory`.

| Parameters |
|---|---|
| `factory: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory` to forward to. |

## Public functions

### createMediaSource

```
fun createMediaSource(mediaItem: MediaItem!): MediaSource!
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource` with the specified `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`.

| Parameters |
|---|---|
| `mediaItem: https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem!` | The media item to play. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource!` | The new `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource`. |

### experimentalParseSubtitlesDuringExtraction

```
fun experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
): MediaSource.Factory!
```

> [!CAUTION]
> **This function is deprecated.**   
>
> This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release.

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to `true` (i.e. subtitles will be parsed during extraction).

This method is experimental and will be renamed or removed in a future release.

| Parameters |
|---|---|
| `parseSubtitlesDuringExtraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether to parse subtitles during extraction or rendering. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |

### getSupportedTypes

```
@C.ContentType
fun getSupportedTypes(): Array<Int>!
```

Returns the `https://developer.android.com/reference/kotlin/androidx/media3/common/C.ContentType` supported by media sources created by this factory.

### setCmcdConfigurationFactory

```
fun setCmcdConfigurationFactory(
    cmcdConfigurationFactory: CmcdConfiguration.Factory!
): MediaSource.Factory!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration.Factory` used to obtain a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/CmcdConfiguration` for a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |

### setDownloadExecutor

```
fun setDownloadExecutor(downloadExecutor: Supplier<ReleasableExecutor!>!): MediaSource.Factory!
```

Sets a supplier for an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor` that is used for loading the media.

| Parameters |
|---|---|
| `downloadExecutor: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html<https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor!>!` | A `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html` that provides an externally managed `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/util/ReleasableExecutor` for downloading and extraction. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |

### setDrmSessionManagerProvider

```
fun setDrmSessionManagerProvider(
    drmSessionManagerProvider: DrmSessionManagerProvider!
): MediaSource.Factory!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionManagerProvider` used to obtain a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/drm/DrmSessionManager` for a `https://developer.android.com/reference/kotlin/androidx/media3/common/MediaItem`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |

### setLoadErrorHandlingPolicy

```
fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): MediaSource.Factory!
```

Sets an optional `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/LoadErrorHandlingPolicy`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |

### setSubtitleParserFactory

```
fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): MediaSource.Factory!
```

Sets the `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` to be used for parsing subtitles during extraction.

| Parameters |
|---|---|
| `subtitleParserFactory: https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory!` | The `https://developer.android.com/reference/kotlin/androidx/media3/extractor/text/SubtitleParser.Factory` for parsing subtitles during extraction. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/MediaSource.Factory!` | This factory, for convenience. |