Action.PlayUntilPosition


public final class Action.PlayUntilPosition extends Action


Schedules a play action to be executed, waits until the player reaches the specified position, and pauses the player again.

Summary

Public constructors

PlayUntilPosition(
    @Size(max = 23) String tag,
    int mediaItemIndex,
    long positionMs
)

Protected methods

void
doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Public constructors

PlayUntilPosition

public PlayUntilPosition(
    @Size(max = 23) String tag,
    int mediaItemIndex,
    long positionMs
)
Parameters
@Size(max = 23) String tag

A tag to use for logging.

int mediaItemIndex

The media item index at which the player should be paused again.

long positionMs

The position in that media item at which the player should be paused again.

Protected methods

doActionImpl

protected void doActionImpl(
    ExoPlayer player,
    DefaultTrackSelector trackSelector,
    @Nullable Surface surface
)

Called by doActionAndScheduleNextImpl to perform the action.

Parameters
ExoPlayer player

The player to which the action should be applied.

DefaultTrackSelector trackSelector

The track selector to which the action should be applied.

@Nullable Surface surface

The surface to use when applying actions, or null if no surface is needed.