# MediaSourceFactorySupplier

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/preload/MediaSourceFactorySupplier.java+class:androidx.media3.exoplayer.source.preload.MediaSourceFactorySupplier)

*** ** * ** ***


```
@UnstableApi
public interface MediaSourceFactorySupplier extends Supplier<MediaSource.Factory>
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier#setCache(androidx.media3.datasource.cache.Cache)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/cache/Cache cache)` Sets the `https://developer.android.com/reference/androidx/media3/datasource/cache/Cache` that will be used by the supplied `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory`. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier#setDataSourceFactory(androidx.media3.datasource.DataSource.Factory)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory dataSourceFactory)` Sets the `https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory` that will be used by the supplied `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory`. |

### Inherited methods

From [com.google.common.base.Supplier](https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html) `abstract boolean` `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html object)` `abstract T` `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/base/Supplier.html#get()()`

## Public methods

### setCache

```
@CanIgnoreReturnValue
abstract MediaSourceFactorySupplier setCache(@Nullable Cache cache)
```

Sets the `https://developer.android.com/reference/androidx/media3/datasource/cache/Cache` that will be used by the supplied `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory`.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier` | This supplier, for convenience. |

### setDataSourceFactory

```
@CanIgnoreReturnValue
abstract MediaSourceFactorySupplier setDataSourceFactory(@Nullable DataSource.Factory dataSourceFactory)
```

Sets the `https://developer.android.com/reference/androidx/media3/datasource/DataSource.Factory` that will be used by the supplied `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory`.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/preload/MediaSourceFactorySupplier` | This supplier, for convenience. |