From 6c80a82baec518108526f165ab819285d2cebd7e Mon Sep 17 00:00:00 2001 From: ibaker Date: Thu, 14 Apr 2022 20:24:00 +0100 Subject: [PATCH] Rename `Player.COMMAND_GET_TRACK_INFOS` to `COMMAND_GET_TRACKS` `Player.getCurrentTracksInfo` was renamed to `Player.getCurrentTracks` in https://github.com/google/ExoPlayer/commit/0ad508b14f232a2d9551cdead61c3e7fa9c0e9e8. PiperOrigin-RevId: 441825078 --- .../google/android/exoplayer2/ext/cast/CastPlayer.java | 2 +- .../java/com/google/android/exoplayer2/Player.java | 10 +++++----- .../com/google/android/exoplayer2/ExoPlayerImpl.java | 2 +- .../com/google/android/exoplayer2/ExoPlayerTest.java | 6 +++--- .../com/google/android/exoplayer2/ui/PlayerView.java | 2 +- .../android/exoplayer2/ui/StyledPlayerControlView.java | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java b/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java index 5470d816d8..7136107b3d 100644 --- a/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java +++ b/extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java @@ -100,7 +100,7 @@ public final class CastPlayer extends BasePlayer { COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_SET_MEDIA_ITEMS_METADATA, COMMAND_CHANGE_MEDIA_ITEMS, - COMMAND_GET_TRACK_INFOS) + COMMAND_GET_TRACKS) .build(); public static final float MIN_SPEED_SUPPORTED = 0.5f; 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 813d6c7108..12560c5ef2 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 @@ -380,7 +380,7 @@ public interface Player { COMMAND_SET_VIDEO_SURFACE, COMMAND_GET_TEXT, COMMAND_SET_TRACK_SELECTION_PARAMETERS, - COMMAND_GET_TRACK_INFOS, + COMMAND_GET_TRACKS, }; private final FlagSet.Builder flagsBuilder; @@ -1378,7 +1378,7 @@ public interface Player { * #COMMAND_GET_VOLUME}, {@link #COMMAND_GET_DEVICE_VOLUME}, {@link #COMMAND_SET_VOLUME}, {@link * #COMMAND_SET_DEVICE_VOLUME}, {@link #COMMAND_ADJUST_DEVICE_VOLUME}, {@link * #COMMAND_SET_VIDEO_SURFACE}, {@link #COMMAND_GET_TEXT}, {@link - * #COMMAND_SET_TRACK_SELECTION_PARAMETERS} or {@link #COMMAND_GET_TRACK_INFOS}. + * #COMMAND_SET_TRACK_SELECTION_PARAMETERS} or {@link #COMMAND_GET_TRACKS}. */ // @Target list includes both 'default' targets and TYPE_USE, to ensure backwards compatibility // with Kotlin usages from before TYPE_USE was added. @@ -1416,7 +1416,7 @@ public interface Player { COMMAND_SET_VIDEO_SURFACE, COMMAND_GET_TEXT, COMMAND_SET_TRACK_SELECTION_PARAMETERS, - COMMAND_GET_TRACK_INFOS, + COMMAND_GET_TRACKS, }) @interface Command {} /** Command to start, pause or resume playback. */ @@ -1493,8 +1493,8 @@ public interface Player { int COMMAND_GET_TEXT = 28; /** Command to set the player's track selection parameters. */ int COMMAND_SET_TRACK_SELECTION_PARAMETERS = 29; - /** Command to get track infos. */ - int COMMAND_GET_TRACK_INFOS = 30; + /** Command to get details of the current track selection. */ + int COMMAND_GET_TRACKS = 30; /** Represents an invalid {@link Command}. */ int COMMAND_INVALID = -1; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index d2c4cbb53c..3496b2eb0d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -283,7 +283,7 @@ import java.util.concurrent.TimeoutException; COMMAND_GET_MEDIA_ITEMS_METADATA, COMMAND_SET_MEDIA_ITEMS_METADATA, COMMAND_CHANGE_MEDIA_ITEMS, - COMMAND_GET_TRACK_INFOS, + COMMAND_GET_TRACKS, COMMAND_GET_AUDIO_ATTRIBUTES, COMMAND_GET_VOLUME, COMMAND_GET_DEVICE_VOLUME, diff --git a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java index 1341f3fbd6..b02b2fd73e 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java @@ -23,7 +23,7 @@ import static com.google.android.exoplayer2.Player.COMMAND_GET_DEVICE_VOLUME; import static com.google.android.exoplayer2.Player.COMMAND_GET_MEDIA_ITEMS_METADATA; import static com.google.android.exoplayer2.Player.COMMAND_GET_TEXT; import static com.google.android.exoplayer2.Player.COMMAND_GET_TIMELINE; -import static com.google.android.exoplayer2.Player.COMMAND_GET_TRACK_INFOS; +import static com.google.android.exoplayer2.Player.COMMAND_GET_TRACKS; import static com.google.android.exoplayer2.Player.COMMAND_GET_VOLUME; import static com.google.android.exoplayer2.Player.COMMAND_PLAY_PAUSE; import static com.google.android.exoplayer2.Player.COMMAND_PREPARE; @@ -8978,7 +8978,7 @@ public final class ExoPlayerTest { assertThat(player.isCommandAvailable(COMMAND_SET_VIDEO_SURFACE)).isTrue(); assertThat(player.isCommandAvailable(COMMAND_GET_TEXT)).isTrue(); assertThat(player.isCommandAvailable(COMMAND_SET_TRACK_SELECTION_PARAMETERS)).isTrue(); - assertThat(player.isCommandAvailable(COMMAND_GET_TRACK_INFOS)).isTrue(); + assertThat(player.isCommandAvailable(COMMAND_GET_TRACKS)).isTrue(); } @Test @@ -12127,7 +12127,7 @@ public final class ExoPlayerTest { COMMAND_SET_VIDEO_SURFACE, COMMAND_GET_TEXT, COMMAND_SET_TRACK_SELECTION_PARAMETERS, - COMMAND_GET_TRACK_INFOS); + COMMAND_GET_TRACKS); if (!isTimelineEmpty) { builder.add(COMMAND_SEEK_TO_PREVIOUS); } diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java index a92f277959..5ebb2caa8d 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java @@ -1229,7 +1229,7 @@ public class PlayerView extends FrameLayout implements AdViewProvider { private void updateForCurrentTrackSelections(boolean isNewPlayer) { @Nullable Player player = this.player; if (player == null - || !player.isCommandAvailable(Player.COMMAND_GET_TRACK_INFOS) + || !player.isCommandAvailable(Player.COMMAND_GET_TRACKS) || player.getCurrentTracks().isEmpty()) { if (!keepContentOnPlayerReset) { hideArtwork(); diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java index 1907a8c9bf..fdc96e6121 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerControlView.java @@ -1102,7 +1102,7 @@ public class StyledPlayerControlView extends FrameLayout { textTrackSelectionAdapter.clear(); audioTrackSelectionAdapter.clear(); if (player == null - || !player.isCommandAvailable(Player.COMMAND_GET_TRACK_INFOS) + || !player.isCommandAvailable(Player.COMMAND_GET_TRACKS) || !player.isCommandAvailable(Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS)) { return; }