@UnstableApi
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

Calls addMediaSources.

Calls clearMediaItems}.

Calls clearVideoSurface.

Calls Runnable.run().

Calls moveMediaItem.

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

Calls prepare.

Calls removeMediaItem.

Calls removeMediaItems.

Calls seekTo or seekTo.

Calls createMessage and send.

Calls setAudioAttributes.

Calls setMediaSources.

Calls setMediaSources.

Calls setPlayWhenReady.

Calls setPlaybackParameters.

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

Calls setRepeatMode.

Calls setShuffleModeEnabled.

Calls setShuffleOrder .

Calls setVideoSurface.

Calls stop.

Throws a playback exception on the playback thread.

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

Waits for a player message to arrive.

Waits until the player acknowledged all pending player commands.

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

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

Waits for onPositionDiscontinuity.

Waits for onTimelineChanged.

Public constructors

Action(tag: @Size(max = 23) String!, description: String?)

Protected functions

abstract Unit
doActionImpl(
    player: ExoPlayer!,
    trackSelector: DefaultTrackSelector!,
    surface: Surface?
)

Called by doActionAndScheduleNextImpl to perform the action.

Public constructors

Action

Action(tag: @Size(max = 23) String!, description: String?)
Parameters
tag: @Size(max = 23) String!

A tag to use for logging.

description: String?

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

Protected functions

doActionImpl

protected abstract fun doActionImpl(
    player: ExoPlayer!,
    trackSelector: DefaultTrackSelector!,
    surface: Surface?
): Unit

Called by doActionAndScheduleNextImpl to perform the action.

Parameters
player: ExoPlayer!

The player to which the action should be applied.

trackSelector: DefaultTrackSelector!

The track selector to which the action should be applied.

surface: Surface?

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