# DefaultAssetLoaderFactory

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/DefaultAssetLoaderFactory.java+class:androidx.media3.transformer.DefaultAssetLoaderFactory)

*** ** * ** ***


```
@UnstableApi
public final class DefaultAssetLoaderFactory implements AssetLoader.Factory
```

<br />

*** ** * ** ***

The default `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader.Factory` implementation.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/transformer/DefaultAssetLoaderFactory#DefaultAssetLoaderFactory(android.content.Context,androidx.media3.common.util.BitmapLoader)(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader bitmapLoader)` Creates an instance with the default `https://developer.android.com/reference/androidx/media3/common/util/Clock` and `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory`. |
| `https://developer.android.com/reference/androidx/media3/transformer/DefaultAssetLoaderFactory#DefaultAssetLoaderFactory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,android.media.metrics.LogSessionId)( 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/android/media/metrics/LogSessionId.html logSessionId )` Creates an instance. |
| `https://developer.android.com/reference/androidx/media3/transformer/DefaultAssetLoaderFactory#DefaultAssetLoaderFactory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,androidx.media3.exoplayer.source.MediaSource.Factory,androidx.media3.common.util.BitmapLoader)( 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/media3/common/util/BitmapLoader bitmapLoader )` Creates an instance. |
| `https://developer.android.com/reference/androidx/media3/transformer/DefaultAssetLoaderFactory#DefaultAssetLoaderFactory(android.content.Context,androidx.media3.transformer.Codec.DecoderFactory,androidx.media3.common.util.Clock,androidx.media3.exoplayer.source.MediaSource.Factory,androidx.media3.common.util.BitmapLoader,androidx.media3.exoplayer.trackselection.TrackSelector.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/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/source/MediaSource.Factory mediaSourceFactory, https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader bitmapLoader, https://developer.android.com/reference/androidx/media3/exoplayer/trackselection/TrackSelector.Factory trackSelectorFactory )` Creates an instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/transformer/AssetLoader` | `https://developer.android.com/reference/androidx/media3/transformer/DefaultAssetLoaderFactory#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

### DefaultAssetLoaderFactory

```
public DefaultAssetLoaderFactory(Context context, BitmapLoader bitmapLoader)
```

Creates an instance with the default `https://developer.android.com/reference/androidx/media3/common/util/Clock` and `https://developer.android.com/reference/androidx/media3/transformer/Codec.DecoderFactory`.

For multi-picture formats (e.g. gifs), a single image frame from the container is loaded. The frame loaded is determined by the `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader` implementation.

| 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/common/util/BitmapLoader bitmapLoader` | The `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader` to use to load and decode images. |

### DefaultAssetLoaderFactory

```
public DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    @Nullable LogSessionId logSessionId
)
```

Creates an instance.

Uses `https://developer.android.com/reference/androidx/media3/datasource/DataSourceBitmapLoader` to load images, setting the `https://developer.android.com/reference/android/graphics/BitmapFactory.Options.html#inPreferredColorSpace` to `https://developer.android.com/reference/android/graphics/ColorSpace.Named.html#SRGB` when possible.

| 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/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`. |

### DefaultAssetLoaderFactory

```
public DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    @Nullable MediaSource.Factory mediaSourceFactory,
    BitmapLoader bitmapLoader
)
```

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 when an `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader` is used. |
| `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader bitmapLoader` | The `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader` to use to load and decode images. |

### DefaultAssetLoaderFactory

```
public DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    @Nullable MediaSource.Factory mediaSourceFactory,
    BitmapLoader bitmapLoader,
    TrackSelector.Factory trackSelectorFactory
)
```

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 when an `https://developer.android.com/reference/androidx/media3/transformer/ExoPlayerAssetLoader` is used. |
| `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader bitmapLoader` | The `https://developer.android.com/reference/androidx/media3/common/util/BitmapLoader` to use to load and decode images. |
| `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. |

## 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`. |