ActionSchedule.PlayerTarget


public abstract class ActionSchedule.PlayerTarget implements PlayerMessage.Target


Provides a wrapper for a Target which has access to the player when handling messages. Can be used with sendMessage.

The target can be passed to waitForMessage to wait for a message to arrive at the target.

Summary

Nested types

Callback to be called when message arrives.

Public constructors

Public methods

final void
handleMessage(
    @Renderer.MessageType int messageType,
    @Nullable Object message
)

Handles a message delivered to the target.

abstract void
handleMessage(ExoPlayer player, int messageType, @Nullable Object message)

Handles the message send to the component and additionally provides access to the player.

void

Public constructors

PlayerTarget

public PlayerTarget()

Public methods

handleMessage

public final void handleMessage(
    @Renderer.MessageType int messageType,
    @Nullable Object message
)

Handles a message delivered to the target.

Parameters
@Renderer.MessageType int messageType

The message type.

@Nullable Object message

The message payload.

Throws
androidx.media3.exoplayer.ExoPlaybackException

If an error occurred whilst handling the message. Should only be thrown by targets that handle messages on the playback thread.

handleMessage

public abstract void handleMessage(ExoPlayer player, int messageType, @Nullable Object message)

Handles the message send to the component and additionally provides access to the player.

setCallback

public void setCallback(ActionSchedule.PlayerTarget.Callback callback)