public interface

Transformer.Listener

 androidx.media3.transformer.Transformer.Listener

Overview

A listener for the transformation events.

Summary

Methods
public voidonFallbackApplied(MediaItem inputMediaItem, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)

Called when fallback to an alternative TransformationRequest is necessary to comply with muxer or device constraints.

public voidonTransformationCompleted(MediaItem inputMediaItem)

Called when the transformation is completed successfully.

public voidonTransformationError(MediaItem inputMediaItem, java.lang.Exception exception)

public voidonTransformationError(MediaItem inputMediaItem, TransformationException exception)

Called if an exception occurs during the transformation.

Methods

public void onTransformationCompleted(MediaItem inputMediaItem)

Called when the transformation is completed successfully.

Parameters:

inputMediaItem: The MediaItem for which the transformation is completed.

public void onTransformationError(MediaItem inputMediaItem, java.lang.Exception exception)

Deprecated: Use Transformer.Listener.onTransformationError(MediaItem, TransformationException).

public void onTransformationError(MediaItem inputMediaItem, TransformationException exception)

Called if an exception occurs during the transformation.

Parameters:

inputMediaItem: The MediaItem for which the exception occurs.
exception: The TransformationException describing the exception.

public void onFallbackApplied(MediaItem inputMediaItem, TransformationRequest originalTransformationRequest, TransformationRequest fallbackTransformationRequest)

Called when fallback to an alternative TransformationRequest is necessary to comply with muxer or device constraints.

Parameters:

inputMediaItem: The MediaItem for which the transformation is requested.
originalTransformationRequest: The unsupported TransformationRequest used when building Transformer.
fallbackTransformationRequest: The alternative TransformationRequest.