RetryPlaybackCallback

fun interface RetryPlaybackCallback

Callback that allows the application to define the behavior when a playback error occurs.

The onPlaybackError method is invoked on the playback thread and must not block or make any calls to the Player or Source to avoid race conditions or deadlock. Post on the main thread to modify the app or player state.

The method should return a RetryPlaybackAction that indicates the action to take in response to the error:

  • If the action is RetryPlaybackAction.None, playback will not be retried, and the error will be propagated to the application via the appropriate error event.

  • Other RetryPlaybackAction values may trigger a retry or different error handling behavior.

See also

Limitations

  • When recovering some error, the callback is invoked a second time even though the error was recovered. This is a limitation of the underlying ExoPlayer implementation. The same action should be returned as for the first invocation.

  • Some rare errors (such as NullPointerException, IllegalStateException and other unexpected RuntimeException) cannot be recovered and will not invoke this method.

Functions

Link copied to clipboard

Invoked when a playback error occurs, allowing the application to determine how to proceed.