Class Action
- java.lang.Object
-
- com.google.android.exoplayer2.testutil.Action
-
- Direct Known Subclasses:
Action.AddMediaItems,Action.ClearMediaItems,Action.ClearVideoSurface,Action.ExecuteRunnable,Action.MoveMediaItem,Action.PlayUntilPosition,Action.Prepare,Action.RemoveMediaItem,Action.RemoveMediaItems,Action.Seek,Action.SendMessages,Action.SetAudioAttributes,Action.SetMediaItems,Action.SetMediaItemsResetPosition,Action.SetPlaybackParameters,Action.SetPlayWhenReady,Action.SetRendererDisabled,Action.SetRepeatMode,Action.SetShuffleModeEnabled,Action.SetShuffleOrder,Action.SetVideoSurface,Action.Stop,Action.ThrowPlaybackException,Action.WaitForIsLoading,Action.WaitForMessage,Action.WaitForPendingPlayerCommands,Action.WaitForPlaybackState,Action.WaitForPlayWhenReady,Action.WaitForPositionDiscontinuity,Action.WaitForTimelineChanged
public abstract class Action extends Object
Base class for actions to perform during playback tests.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAction.AddMediaItemsstatic classAction.ClearMediaItemsCallsPlayer.clearMediaItems()}.static classAction.ClearVideoSurfaceCallsPlayer.clearVideoSurface().static classAction.ExecuteRunnableCallsRunnable.run().static classAction.MoveMediaItemstatic classAction.PlayUntilPositionSchedules a play action to be executed, waits until the player reaches the specified position, and pauses the player again.static classAction.PrepareCallsPlayer.prepare().static classAction.RemoveMediaItemCallsPlayer.removeMediaItem(int).static classAction.RemoveMediaItemsstatic classAction.SeekCallsPlayer.seekTo(long)orPlayer.seekTo(int, long).static classAction.SendMessagesstatic classAction.SetAudioAttributesstatic classAction.SetMediaItemsstatic classAction.SetMediaItemsResetPositionstatic classAction.SetPlaybackParametersstatic classAction.SetPlayWhenReadystatic classAction.SetRendererDisabledUpdates theDefaultTrackSelector.Parametersof aDefaultTrackSelectorto specify whether the renderer at a given index should be disabled.static classAction.SetRepeatModeCallsPlayer.setRepeatMode(int).static classAction.SetShuffleModeEnabledstatic classAction.SetShuffleOrderstatic classAction.SetVideoSurfacestatic classAction.StopCallsPlayer.stop()orPlayer.stop(boolean).static classAction.ThrowPlaybackExceptionThrows a playback exception on the playback thread.static classAction.WaitForIsLoadingWaits for a specified loading state, returning either immediately or after a call toPlayer.Listener.onIsLoadingChanged(boolean).static classAction.WaitForMessageWaits for a player message to arrive.static classAction.WaitForPendingPlayerCommandsWaits until the player acknowledged all pending player commands.static classAction.WaitForPlaybackStateWaits for a specified playback state, returning either immediately or after a call toPlayer.Listener.onPlaybackStateChanged(int).static classAction.WaitForPlayWhenReadyWaits for a specified playWhenReady value, returning either immediately or after a call toPlayer.Listener.onPlayWhenReadyChanged(boolean, int).static classAction.WaitForPositionDiscontinuitystatic classAction.WaitForTimelineChanged
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddoActionAndScheduleNext(ExoPlayer player, DefaultTrackSelector trackSelector, Surface surface, HandlerWrapper handler, com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode nextAction)Executes the action and schedules the next.protected voiddoActionAndScheduleNextImpl(ExoPlayer player, DefaultTrackSelector trackSelector, Surface surface, HandlerWrapper handler, com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode nextAction)Called bydoActionAndScheduleNext(ExoPlayer, DefaultTrackSelector, Surface, HandlerWrapper, ActionNode)to perform the action and to schedule the next action node.protected abstract voiddoActionImpl(ExoPlayer player, DefaultTrackSelector trackSelector, Surface surface)Called bydoActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface, HandlerWrapper, ActionNode)to perform the action.
-
-
-
Method Detail
-
doActionAndScheduleNext
public final void doActionAndScheduleNext(ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface, HandlerWrapper handler, @Nullable com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode nextAction)
Executes the action and schedules the next.- Parameters:
player- The player to which the action should be applied.trackSelector- The track selector to which the action should be applied.surface- The surface to use when applying actions, ornullif no surface is needed.handler- The handler to use to pass to the next action.nextAction- The next action to schedule immediately after this action finished, ornullif there's no next action.
-
doActionAndScheduleNextImpl
protected void doActionAndScheduleNextImpl(ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface, HandlerWrapper handler, @Nullable com.google.android.exoplayer2.testutil.ActionSchedule.ActionNode nextAction)
Called bydoActionAndScheduleNext(ExoPlayer, DefaultTrackSelector, Surface, HandlerWrapper, ActionNode)to perform the action and to schedule the next action node.- Parameters:
player- The player to which the action should be applied.trackSelector- The track selector to which the action should be applied.surface- The surface to use when applying actions, ornullif no surface is needed.handler- The handler to use to pass to the next action.nextAction- The next action to schedule immediately after this action finished, ornullif there's no next action.
-
doActionImpl
protected abstract void doActionImpl(ExoPlayer player, DefaultTrackSelector trackSelector, @Nullable Surface surface)
Called bydoActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface, HandlerWrapper, ActionNode)to perform the action.- Parameters:
player- The player to which the action should be applied.trackSelector- The track selector to which the action should be applied.surface- The surface to use when applying actions, ornullif no surface is needed.
-
-