@UnstableApi
public abstract class Action

Known direct subclasses
Action.AddMediaItems

Calls addMediaSources.

Action.ClearMediaItems

Calls clearMediaItems}.

Action.ClearVideoSurface

Calls clearVideoSurface.

Action.ExecuteRunnable

Calls Runnable.run().

Action.MoveMediaItem

Calls moveMediaItem.

Action.PlayUntilPosition

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

Action.Prepare

Calls prepare.

Action.RemoveMediaItem

Calls removeMediaItem.

Action.RemoveMediaItems

Calls removeMediaItems.

Action.Seek

Calls seekTo or seekTo.

Action.SendMessages

Calls createMessage and send.

Action.SetAudioAttributes

Calls setAudioAttributes.

Action.SetMediaItemsResetPosition

Calls setMediaSources.

Action.SetMediaItems

Calls setMediaSources.

Action.SetPlayWhenReady

Calls setPlayWhenReady.

Action.SetPlaybackParameters

Calls setPlaybackParameters.

Action.SetRendererDisabled

Updates the Parameters of a DefaultTrackSelector to specify whether the renderer at a given index should be disabled.

Action.SetRepeatMode

Calls setRepeatMode.

Action.SetShuffleModeEnabled

Calls setShuffleModeEnabled.

Action.SetShuffleOrder

Calls setShuffleOrder .

Action.SetVideoSurface

Calls setVideoSurface.

Action.Stop

Calls stop.

Action.ThrowPlaybackException

Throws a playback exception on the playback thread.

Action.WaitForIsLoading

Waits for a specified loading state, returning either immediately or after a call to onIsLoadingChanged.

Action.WaitForMessage

Waits for a player message to arrive.

Action.WaitForPendingPlayerCommands

Waits until the player acknowledged all pending player commands.

Action.WaitForPlayWhenReady

Waits for a specified playWhenReady value, returning either immediately or after a call to onPlayWhenReadyChanged.

Action.WaitForPlaybackState

Waits for a specified playback state, returning either immediately or after a call to onPlaybackStateChanged.

Action.WaitForPositionDiscontinuity

Waits for onPositionDiscontinuity.

Action.WaitForTimelineChanged

Waits for onTimelineChanged.


Base class for actions to perform during playback tests.

Summary

Nested types

public final class Action.AddMediaItems extends Action

Calls addMediaSources.

public class Action.ClearMediaItems extends Action

Calls clearMediaItems}.

public final class Action.ClearVideoSurface extends Action

Calls clearVideoSurface.

public final class Action.ExecuteRunnable extends Action

Calls Runnable.run().

public class Action.MoveMediaItem extends Action

Calls moveMediaItem.

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.

public final class Action.Prepare extends Action

Calls prepare.

public class Action.RemoveMediaItem extends Action

Calls removeMediaItem.

public class Action.RemoveMediaItems extends Action

Calls removeMediaItems.

public final class Action.Seek extends Action

Calls seekTo or seekTo.

public final class Action.SendMessages extends Action

Calls createMessage and send.

public final class Action.SetAudioAttributes extends Action

Calls setAudioAttributes.

public final class Action.SetMediaItems extends Action

Calls setMediaSources.

public final class Action.SetMediaItemsResetPosition extends Action

Calls setMediaSources.

public final class Action.SetPlayWhenReady extends Action

Calls setPlayWhenReady.

public final class Action.SetPlaybackParameters extends Action

Calls setPlaybackParameters.

public final class Action.SetRendererDisabled extends Action

Updates the Parameters of a DefaultTrackSelector to specify whether the renderer at a given index should be disabled.

public final class Action.SetRepeatMode extends Action

Calls setRepeatMode.

public final class Action.SetShuffleModeEnabled extends Action

Calls setShuffleModeEnabled.

public final class Action.SetShuffleOrder extends Action

Calls setShuffleOrder .

public final class Action.SetVideoSurface extends Action

Calls setVideoSurface.

public final class Action.Stop extends Action

Calls stop.

public final class Action.ThrowPlaybackException extends Action

Throws a playback exception on the playback thread.

public final class Action.WaitForIsLoading extends Action

Waits for a specified loading state, returning either immediately or after a call to onIsLoadingChanged.

public final class Action.WaitForMessage extends Action

Waits for a player message to arrive.

public final class Action.WaitForPendingPlayerCommands extends Action

Waits until the player acknowledged all pending player commands.

public final class Action.WaitForPlayWhenReady extends Action

Waits for a specified playWhenReady value, returning either immediately or after a call to onPlayWhenReadyChanged.

public final class Action.WaitForPlaybackState extends Action

Waits for a specified playback state, returning either immediately or after a call to onPlaybackStateChanged.

public final class Action.WaitForPositionDiscontinuity extends Action

Waits for onPositionDiscontinuity.

public final class Action.WaitForTimelineChanged extends Action

Waits for onTimelineChanged.

Public constructors

Action(@Size(max = 23) String tag, @Nullable String description)

Protected methods

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

Called by doActionAndScheduleNextImpl to perform the action.

Public constructors

Action

public Action(@Size(max = 23) String tag, @Nullable String description)
Parameters
@Size(max = 23) String tag

A tag to use for logging.

@Nullable String description

A description to be logged when the action is executed, or null if no logging is required.

Protected methods

doActionImpl

protected abstract 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.