Transformer.Listener


interface Transformer.Listener


A listener for the export events.

If the export is not cancelled, either onError or onCompleted will be called once for each export.

Summary

Public functions

Unit
onCompleted(composition: Composition!, exportResult: ExportResult!)

Called when the export is completed successfully.

Unit
onError(
    composition: Composition!,
    exportResult: ExportResult!,
    exportException: ExportException!
)

Called if an exception occurs during the export.

Unit
onFallbackApplied(
    composition: Composition!,
    originalTransformationRequest: TransformationRequest!,
    fallbackTransformationRequest: TransformationRequest!
)

Called when falling back to an alternative TransformationRequest or changing the video frames' resolution is necessary to comply with muxer or device constraints.

Unit
onFallbackApplied(
    inputMediaItem: MediaItem!,
    originalTransformationRequest: TransformationRequest!,
    fallbackTransformationRequest: TransformationRequest!
)

This function is deprecated.

Use onFallbackApplied instead.

Unit

This function is deprecated.

Use onCompleted instead.

Unit
onTransformationCompleted(
    inputMediaItem: MediaItem!,
    result: TransformationResult!
)

This function is deprecated.

Use onCompleted instead.

Unit
onTransformationError(inputMediaItem: MediaItem!, exception: Exception!)

This function is deprecated.

Use onError instead.

Unit
onTransformationError(
    inputMediaItem: MediaItem!,
    exception: TransformationException!
)

This function is deprecated.

Use onError instead.

Unit
onTransformationError(
    inputMediaItem: MediaItem!,
    result: TransformationResult!,
    exception: TransformationException!
)

This function is deprecated.

Use onError instead.

Public functions

onCompleted

fun onCompleted(composition: Composition!, exportResult: ExportResult!): Unit

Called when the export is completed successfully.

Parameters
composition: Composition!

The Composition for which the export is completed.

exportResult: ExportResult!

The ExportResult of the export.

onError

fun onError(
    composition: Composition!,
    exportResult: ExportResult!,
    exportException: ExportException!
): Unit

Called if an exception occurs during the export.

The export output file (if any) is not deleted in this case.

Parameters
composition: Composition!

The Composition for which the exception occurs.

exportResult: ExportResult!

The ExportResult of the export.

exportException: ExportException!

The ExportException describing the exception. This is the same instance as the exception in result.

onFallbackApplied

fun onFallbackApplied(
    composition: Composition!,
    originalTransformationRequest: TransformationRequest!,
    fallbackTransformationRequest: TransformationRequest!
): Unit

Called when falling back to an alternative TransformationRequest or changing the video frames' resolution is necessary to comply with muxer or device constraints.

Parameters
composition: Composition!

The Composition for which the export is requested.

originalTransformationRequest: TransformationRequest!

The unsupported TransformationRequest used when building Transformer.

fallbackTransformationRequest: TransformationRequest!

The alternative TransformationRequest, with supported audioMimeType, videoMimeType, outputHeight, and hdrMode values set.

onFallbackApplied

fun onFallbackApplied(
    inputMediaItem: MediaItem!,
    originalTransformationRequest: TransformationRequest!,
    fallbackTransformationRequest: TransformationRequest!
): Unit

onTransformationCompleted

fun onTransformationCompleted(inputMediaItem: MediaItem!): Unit

onTransformationCompleted

fun onTransformationCompleted(
    inputMediaItem: MediaItem!,
    result: TransformationResult!
): Unit

onTransformationError

fun onTransformationError(inputMediaItem: MediaItem!, exception: Exception!): Unit

onTransformationError

fun onTransformationError(
    inputMediaItem: MediaItem!,
    exception: TransformationException!
): Unit

onTransformationError

fun onTransformationError(
    inputMediaItem: MediaItem!,
    result: TransformationResult!,
    exception: TransformationException!
): Unit