docs/doc/reference/com/google/android/exoplayer2/testutil/Action.html
Package com.google.android.exoplayer2.testutil
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 classActionextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Base class for actions to perform during playback tests.
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static class | Action.AddMediaItems |
Calls ExoPlayer.addMediaSources(List).
|
| static class | Action.ClearMediaItems |
Calls Player.clearMediaItems()}.
|
| static class | Action.ClearVideoSurface |
Calls Player.clearVideoSurface().
|
| static class | Action.ExecuteRunnable |
Calls Runnable.run().
|
| static class | Action.MoveMediaItem |
Calls Player.moveMediaItem(int, int).
|
| static class | Action.PlayUntilPosition |
Schedules a play action to be executed, waits until the player reaches the specified position, and pauses the player again.
|
| static class | Action.Prepare |
Calls Player.prepare().
|
| static class | Action.RemoveMediaItem |
Calls Player.removeMediaItem(int).
|
| static class | Action.RemoveMediaItems |
Calls Player.removeMediaItems(int, int).
|
| static class | Action.Seek |
Calls Player.seekTo(long) or Player.seekTo(int, long).
|
| static class | Action.SendMessages |
Calls ExoPlayer.createMessage(Target) and PlayerMessage.send().
|
| static class | Action.SetAudioAttributes |
Calls ExoPlayer.setAudioAttributes(AudioAttributes, boolean).
|
| static class | Action.SetMediaItems |
Calls ExoPlayer.setMediaSources(List, int, long).
|
| static class | Action.SetMediaItemsResetPosition |
Calls ExoPlayer.setMediaSources(List, boolean).
|
| static class | Action.SetPlaybackParameters |
Calls Player.setPlaybackParameters(PlaybackParameters).
|
| static class | Action.SetPlayWhenReady |
Calls Player.setPlayWhenReady(boolean).
|
| static class | Action.SetRendererDisabled |
Updates the DefaultTrackSelector.Parameters of a DefaultTrackSelector to specify whether the renderer at a given index should be disabled.
|
| static class | Action.SetRepeatMode |
Calls Player.setRepeatMode(int).
|
| static class | Action.SetShuffleModeEnabled |
Calls Player.setShuffleModeEnabled(boolean).
|
| static class | Action.SetShuffleOrder |
Calls ExoPlayer.setShuffleOrder(ShuffleOrder) .
|
| static class | Action.SetVideoSurface |
Calls Player.setVideoSurface(Surface).
|
| static class | Action.Stop |
Calls Player.stop().
|
| static class | Action.ThrowPlaybackException |
Throws a playback exception on the playback thread.
|
| static class | Action.WaitForIsLoading |
Waits for a specified loading state, returning either immediately or after a call to Player.Listener.onIsLoadingChanged(boolean).
|
| static class | Action.WaitForMessage |
Waits for a player message to arrive.
|
| static class | Action.WaitForPendingPlayerCommands |
Waits until the player acknowledged all pending player commands.
|
| static class | Action.WaitForPlaybackState |
Waits for a specified playback state, returning either immediately or after a call to Player.Listener.onPlaybackStateChanged(int).
|
| static class | Action.WaitForPlayWhenReady |
Waits for a specified playWhenReady value, returning either immediately or after a call to Player.Listener.onPlayWhenReadyChanged(boolean, int).
|
| static class | Action.WaitForPositionDiscontinuity |
Waits for Player.Listener.onPositionDiscontinuity(Player.PositionInfo, Player.PositionInfo, int).
|
| static class | Action.WaitForTimelineChanged |
Waits for Player.Listener.onTimelineChanged(Timeline, int).
|
Constructors | Constructor | Description |
| --- | --- |
| Action(String tag, String description) | |
All Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| protected abstract void | doActionImpl(ExoPlayer player, DefaultTrackSelector trackSelector, Surface surface) |
Called by doActionAndScheduleNextImpl(ExoPlayer, DefaultTrackSelector, Surface, HandlerWrapper, ActionNode) to perform the action.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public Action(@Size(max=23L)[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")tag,
@Nullable[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")description)
Parameters:tag - A tag to use for logging.description - A description to be logged when the action is executed, or null if no logging is required.
-
protected abstract void doActionImpl([ExoPlayer](../ExoPlayer.html "interface in com.google.android.exoplayer2")player,[DefaultTrackSelector](../trackselection/DefaultTrackSelector.html "class in com.google.android.exoplayer2.trackselection")trackSelector,
@Nullable[Surface](https://developer.android.com/reference/android/view/Surface.html "class or interface in android.view")surface)
Called by doActionAndScheduleNextImpl(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, or null if no surface is needed.