From c202d406fbf7a8adc9b633a61826666da6837fa7 Mon Sep 17 00:00:00 2001 From: kimvde Date: Tue, 23 Mar 2021 18:13:23 +0000 Subject: [PATCH] Improve commands Javadoc PiperOrigin-RevId: 364600438 --- .../com/google/android/exoplayer2/Player.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/library/common/src/main/java/com/google/android/exoplayer2/Player.java b/library/common/src/main/java/com/google/android/exoplayer2/Player.java index d23814cfb0..fae8ef5030 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/Player.java @@ -1083,13 +1083,13 @@ public interface Player { int COMMAND_PLAY_PAUSE = 1; /** Command to prepare the player, stop playback or release the player. */ int COMMAND_PREPARE_STOP_RELEASE = 2; - /** Command to seek into the current {@link MediaItem}. */ + /** Command to seek into the current window. */ int COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM = 3; - /** Command to seek to the next {@link MediaItem} in the playlist. */ + /** Command to seek to the default position of the next window. */ int COMMAND_SEEK_TO_NEXT_MEDIA_ITEM = 4; - /** Command to seek to the previous {@link MediaItem} in the playlist. */ + /** Command to seek to the default position of the previous window. */ int COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM = 5; - /** Command to seek to a {@link MediaItem} in the playlist. */ + /** Command to seek anywhere in any window. */ int COMMAND_SEEK_TO_MEDIA_ITEM = 6; /** Command to set the playback speed and pitch. */ int COMMAND_SET_SPEED_AND_PITCH = 7; @@ -1097,9 +1097,9 @@ public interface Player { int COMMAND_SET_SHUFFLE_MODE = 8; /** Command to set the repeat mode. */ int COMMAND_SET_REPEAT_MODE = 9; - /** Command to get the current {@link MediaItem}. */ + /** Command to get the {@link MediaItem} of the current window. */ int COMMAND_GET_CURRENT_MEDIA_ITEM = 10; - /** Command to get the {@link MediaItem MediaItems} in the playlist. */ + /** Command to get the current timeline and its {@link MediaItem MediaItems}. */ int COMMAND_GET_MEDIA_ITEMS = 11; /** Command to get the {@link MediaItem MediaItems} metadata. */ int COMMAND_GET_MEDIA_ITEMS_METADATA = 12; @@ -1107,15 +1107,15 @@ public interface Player { int COMMAND_CHANGE_MEDIA_ITEMS = 13; /** Command to get the player volume. */ int COMMAND_GET_VOLUME = 14; - /** Command to get the device volume. */ + /** Command to get the device volume and whether it is muted. */ int COMMAND_GET_DEVICE_VOLUME = 15; /** Command to set the player volume. */ int COMMAND_SET_VOLUME = 16; - /** Command to set the device volume. */ + /** Command to set the device volume and mute it. */ int COMMAND_SET_DEVICE_VOLUME = 17; - /** Command to increment or decrement the device volume. */ + /** Command to increase and decrease the device volume and mute it. */ int COMMAND_ADJUST_DEVICE_VOLUME = 18; - /** Command to set the surface on which to render the video. */ + /** Command to set and clear the surface on which to render the video. */ int COMMAND_SET_VIDEO_SURFACE = 19; /** Command to get the text that should currently be displayed by the player. */ int COMMAND_GET_TEXT = 20; @@ -1323,6 +1323,9 @@ public interface Player { *

Executing a command that is not available (for example, calling {@link #next()} if {@link * #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} is unavailable) is a no-op. * + *

{@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} and {@link #COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM} + * are unavailable if there is no such {@link MediaItem}. + * * @param command A {@link Command}. * @return Whether the {@link Command} is available. * @see EventListener#onAvailableCommandsChanged(Commands)