# ExoPlayerAssetLoader.Factory

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

*** ** * ** ***


```
public final class ExoPlayerAssetLoader.Factory implements AssetLoader.Factory
```

<br />

*** ** * ** ***

An `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.Factory` for `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader` instances.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader.Factory#Factory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock)( https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory, https://developer.android.com/reference/androidx/media3/common/util/Clock clock )` Creates an instance using a `https://developer.android.com/reference/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`. |
| `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader.Factory#Factory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,androidx.media3.exoplayer.LoadControl)( https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory, https://developer.android.com/reference/androidx/media3/common/util/Clock clock, https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl loadControl )` Creates an instance using a `https://developer.android.com/reference/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`. |
| `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader.Factory#Factory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,androidx.media3.exoplayer.source.MediaSource.Factory)( https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory, https://developer.android.com/reference/androidx/media3/common/util/Clock clock, https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory mediaSourceFactory )` Creates an instance. |
| `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader.Factory#Factory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,androidx.media3.exoplayer.source.MediaSource.Factory,androidx.media3.exoplayer.trackselection.TrackSelector.Factory,android.media.metrics.LogSessionId,androidx.media3.exoplayer.LoadControl)( https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory, https://developer.android.com/reference/androidx/media3/common/util/Clock clock, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory mediaSourceFactory, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/TrackSelector.Factory trackSelectorFactory, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/metrics/LogSessionId.html logSessionId, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl loadControl )` Creates an instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` | `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader.Factory#createAssetLoader(androidx.media3.transformer.EditedMediaItem,android.os.Looper,androidx.media3.transformer.AssetLoader.Listener,androidx.media3.transformer.AssetLoader.CompositionSettings)( https://developer.android.com/reference/androidx/media3/transformer/EditedMediaItem editedMediaItem, https://developer.android.com/reference/android/os/Looper.html looper, https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.Listener listener, https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.CompositionSettings compositionSettings )` Creates an `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` instance. |

## Public constructors

### Factory

```
public Factory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock
)
```

Creates an instance using a `https://developer.android.com/reference/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory` | The `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory` to use to decode the samples (if necessary). |
| `https://developer.android.com/reference/androidx/media3/common/util/Clock clock` | The `https://developer.android.com/reference/androidx/media3/common/util/Clock` to use. It should always be `https://developer.android.com/reference/androidx/media3/common/util/Clock#DEFAULT()`, except for testing. |

### Factory

```
public Factory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    LoadControl loadControl
)
```

Creates an instance using a `https://developer.android.com/reference/androidx/media3/exoplayer/source/DefaultMediaSourceFactory`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory` | The `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory` to use to decode the samples (if necessary). |
| `https://developer.android.com/reference/androidx/media3/common/util/Clock clock` | The `https://developer.android.com/reference/androidx/media3/common/util/Clock` to use. It should always be `https://developer.android.com/reference/androidx/media3/common/util/Clock#DEFAULT()`, except for testing. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl loadControl` | The `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl` to use in the underlying `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer`. |

### Factory

```
public Factory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    MediaSource.Factory mediaSourceFactory
)
```

Creates an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory` | The `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory` to use to decode the samples (if necessary). |
| `https://developer.android.com/reference/androidx/media3/common/util/Clock clock` | The `https://developer.android.com/reference/androidx/media3/common/util/Clock` to use. It should always be `https://developer.android.com/reference/androidx/media3/common/util/Clock#DEFAULT()`, except for testing. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory mediaSourceFactory` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory` to use to retrieve the samples to transform. |

### Factory

```
public Factory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    @Nullable MediaSource.Factory mediaSourceFactory,
    @Nullable TrackSelector.Factory trackSelectorFactory,
    @Nullable LogSessionId logSessionId,
    @Nullable LoadControl loadControl
)
```

Creates an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | The `https://developer.android.com/reference/android/content/Context.html`. |
| `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory decoderFactory` | The `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory` to use to decode the samples (if necessary). |
| `https://developer.android.com/reference/androidx/media3/common/util/Clock clock` | The `https://developer.android.com/reference/androidx/media3/common/util/Clock` to use. It should always be `https://developer.android.com/reference/androidx/media3/common/util/Clock#DEFAULT()`, except for testing. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory mediaSourceFactory` | The `https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory` to use to retrieve the samples to transform. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/TrackSelector.Factory trackSelectorFactory` | The `https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/TrackSelector.Factory` to use when selecting the track to transform. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/metrics/LogSessionId.html logSessionId` | The optional `https://developer.android.com/reference/android/media/metrics/LogSessionId.html` of the `https://developer.android.com/reference/android/media/metrics/EditingSession.html`. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl loadControl` | The `https://developer.android.com/reference/androidx/media3/exoplayer/LoadControl` to use in the underlying `https://developer.android.com/reference/androidx/media3/exoplayer/ExoPlayer`. |

## Public methods

### createAssetLoader

```
public AssetLoader createAssetLoader(
    EditedMediaItem editedMediaItem,
    Looper looper,
    AssetLoader.Listener listener,
    AssetLoader.CompositionSettings compositionSettings
)
```

Creates an `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/EditedMediaItem editedMediaItem` | The `https://developer.android.com/reference/androidx/media3/transformer/EditedMediaItem` to load. |
| `https://developer.android.com/reference/android/os/Looper.html looper` | The `https://developer.android.com/reference/android/os/Looper.html` that's used to access the `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` after it's been created. |
| `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.Listener listener` | The `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.Listener` on which the `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` should notify of events. |
| `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.CompositionSettings compositionSettings` | The `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.CompositionSettings`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` | An `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader`. |