DefaultAssetLoaderFactory


@UnstableApi
class DefaultAssetLoaderFactory : AssetLoader.Factory


The default AssetLoader.Factory implementation.

Summary

Public constructors

DefaultAssetLoaderFactory(context: Context!, bitmapLoader: BitmapLoader!)

Creates an instance with the default Clock and Codec.DecoderFactory.

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    clock: Clock!
)

Creates an instance.

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    clock: Clock!,
    mediaSourceFactory: MediaSource.Factory!,
    bitmapLoader: BitmapLoader!
)

Creates an instance.

Public functions

AssetLoader!
createAssetLoader(
    editedMediaItem: EditedMediaItem!,
    looper: Looper!,
    listener: AssetLoader.Listener!,
    compositionSettings: AssetLoader.CompositionSettings!
)

Creates an AssetLoader instance.

Public constructors

DefaultAssetLoaderFactory

DefaultAssetLoaderFactory(context: Context!, bitmapLoader: BitmapLoader!)

Creates an instance with the default Clock and 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 BitmapLoader implementation.

Parameters
context: Context!

The Context.

bitmapLoader: BitmapLoader!

The BitmapLoader to use to load and decode images.

DefaultAssetLoaderFactory

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    clock: Clock!
)

Creates an instance.

Uses DataSourceBitmapLoader to load images, setting the inPreferredColorSpace to SRGB when possible.

Parameters
context: Context!

The Context.

decoderFactory: Codec.DecoderFactory!

The Codec.DecoderFactory to use to decode the samples (if necessary).

clock: Clock!

The Clock to use. It should always be DEFAULT, except for testing.

DefaultAssetLoaderFactory

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    clock: Clock!,
    mediaSourceFactory: MediaSource.Factory!,
    bitmapLoader: BitmapLoader!
)

Creates an instance.

Parameters
context: Context!

The Context.

decoderFactory: Codec.DecoderFactory!

The Codec.DecoderFactory to use to decode the samples (if necessary).

clock: Clock!

The Clock to use. It should always be DEFAULT, except for testing.

mediaSourceFactory: MediaSource.Factory!

The MediaSource.Factory to use to retrieve the samples to transform when an ExoPlayerAssetLoader is used.

bitmapLoader: BitmapLoader!

The BitmapLoader to use to load and decode images.

Public functions

createAssetLoader

fun createAssetLoader(
    editedMediaItem: EditedMediaItem!,
    looper: Looper!,
    listener: AssetLoader.Listener!,
    compositionSettings: AssetLoader.CompositionSettings!
): AssetLoader!

Creates an AssetLoader instance.

Parameters
editedMediaItem: EditedMediaItem!

The EditedMediaItem to load.

looper: Looper!

The Looper that's used to access the AssetLoader after it's been created.

listener: AssetLoader.Listener!

The Listener on which the AssetLoader should notify of events.

compositionSettings: AssetLoader.CompositionSettings!

The CompositionSettings.

Returns
AssetLoader!

An AssetLoader.