From d83fe03d88f66df1c43d5694c7c540b911be91a4 Mon Sep 17 00:00:00 2001 From: ibaker Date: Wed, 27 Oct 2021 18:51:03 +0100 Subject: [PATCH] Update most Player parameter & doc references from Window to MediaItem Only deprecated references remain. Usages of the deprecated methods will be migrated in a follow-up change. #minor-release PiperOrigin-RevId: 405927141 --- .../java/androidx/media3/cast/CastPlayer.java | 15 ++-- .../androidx/media3/common/BasePlayer.java | 4 +- .../media3/common/ForwardingPlayer.java | 13 ++- .../java/androidx/media3/common/Player.java | 85 ++++++++++--------- .../media3/exoplayer/ExoPlayerImpl.java | 16 ++-- .../media3/exoplayer/SimpleExoPlayer.java | 9 +- .../media3/session/MediaController.java | 25 +++--- .../media3/session/PlayerWrapper.java | 13 ++- .../androidx/media3/session/MockPlayer.java | 13 ++- .../media3/test/utils/StubExoPlayer.java | 5 +- 10 files changed, 98 insertions(+), 100 deletions(-) diff --git a/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java b/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java index c192bfec13..15bad01f45 100644 --- a/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java +++ b/libraries/cast/src/main/java/androidx/media3/cast/CastPlayer.java @@ -326,10 +326,9 @@ public final class CastPlayer extends BasePlayer { } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { setMediaItemsInternal( - toMediaQueueItems(mediaItems), startWindowIndex, startPositionMs, repeatMode.value); + toMediaQueueItems(mediaItems), startIndex, startPositionMs, repeatMode.value); } @Override @@ -440,23 +439,23 @@ public final class CastPlayer extends BasePlayer { // don't implement onPositionDiscontinuity(). @SuppressWarnings("deprecation") @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { MediaStatus mediaStatus = getMediaStatus(); // We assume the default position is 0. There is no support for seeking to the default position // in RemoteMediaClient. positionMs = positionMs != C.TIME_UNSET ? positionMs : 0; if (mediaStatus != null) { - if (getCurrentWindowIndex() != windowIndex) { + if (getCurrentWindowIndex() != mediaItemIndex) { remoteMediaClient .queueJumpToItem( - (int) currentTimeline.getPeriod(windowIndex, period).uid, positionMs, null) + (int) currentTimeline.getPeriod(mediaItemIndex, period).uid, positionMs, null) .setResultCallback(seekResultCallback); } else { remoteMediaClient.seek(positionMs).setResultCallback(seekResultCallback); } PositionInfo oldPosition = getCurrentPositionInfo(); pendingSeekCount++; - pendingSeekWindowIndex = windowIndex; + pendingSeekWindowIndex = mediaItemIndex; pendingSeekPositionMs = positionMs; PositionInfo newPosition = getCurrentPositionInfo(); listeners.queueEvent( @@ -468,7 +467,7 @@ public final class CastPlayer extends BasePlayer { if (oldPosition.mediaItemIndex != newPosition.mediaItemIndex) { // TODO(internal b/182261884): queue `onMediaItemTransition` event when the media item is // repeated. - MediaItem mediaItem = getCurrentTimeline().getWindow(windowIndex, window).mediaItem; + MediaItem mediaItem = getCurrentTimeline().getWindow(mediaItemIndex, window).mediaItem; listeners.queueEvent( Player.EVENT_MEDIA_ITEM_TRANSITION, listener -> diff --git a/libraries/common/src/main/java/androidx/media3/common/BasePlayer.java b/libraries/common/src/main/java/androidx/media3/common/BasePlayer.java index 564ca9e7a7..4f4a241363 100644 --- a/libraries/common/src/main/java/androidx/media3/common/BasePlayer.java +++ b/libraries/common/src/main/java/androidx/media3/common/BasePlayer.java @@ -124,8 +124,8 @@ public abstract class BasePlayer implements Player { } @Override - public final void seekToDefaultPosition(int windowIndex) { - seekTo(windowIndex, /* positionMs= */ C.TIME_UNSET); + public final void seekToDefaultPosition(int mediaItemIndex) { + seekTo(mediaItemIndex, /* positionMs= */ C.TIME_UNSET); } @Override diff --git a/libraries/common/src/main/java/androidx/media3/common/ForwardingPlayer.java b/libraries/common/src/main/java/androidx/media3/common/ForwardingPlayer.java index 39060904e0..6f3a21dfc1 100644 --- a/libraries/common/src/main/java/androidx/media3/common/ForwardingPlayer.java +++ b/libraries/common/src/main/java/androidx/media3/common/ForwardingPlayer.java @@ -65,9 +65,8 @@ public class ForwardingPlayer implements Player { } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { - player.setMediaItems(mediaItems, startWindowIndex, startPositionMs); + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { + player.setMediaItems(mediaItems, startIndex, startPositionMs); } @Override @@ -222,8 +221,8 @@ public class ForwardingPlayer implements Player { } @Override - public void seekToDefaultPosition(int windowIndex) { - player.seekToDefaultPosition(windowIndex); + public void seekToDefaultPosition(int mediaItemIndex) { + player.seekToDefaultPosition(mediaItemIndex); } @Override @@ -232,8 +231,8 @@ public class ForwardingPlayer implements Player { } @Override - public void seekTo(int windowIndex, long positionMs) { - player.seekTo(windowIndex, positionMs); + public void seekTo(int mediaItemIndex, long positionMs) { + player.seekTo(mediaItemIndex, positionMs); } @Override diff --git a/libraries/common/src/main/java/androidx/media3/common/Player.java b/libraries/common/src/main/java/androidx/media3/common/Player.java index 34d2579a3f..3c953e27c2 100644 --- a/libraries/common/src/main/java/androidx/media3/common/Player.java +++ b/libraries/common/src/main/java/androidx/media3/common/Player.java @@ -1512,16 +1512,16 @@ public interface Player { * Clears the playlist and adds the specified {@link MediaItem MediaItems}. * * @param mediaItems The new {@link MediaItem MediaItems}. - * @param startWindowIndex The window index to start playback from. If {@link C#INDEX_UNSET} is - * passed, the current position is not reset. + * @param startIndex The {@link MediaItem} index to start playback from. If {@link C#INDEX_UNSET} + * is passed, the current position is not reset. * @param startPositionMs The position in milliseconds to start playback from. If {@link - * C#TIME_UNSET} is passed, the default position of the given window is used. In any case, if - * {@code startWindowIndex} is set to {@link C#INDEX_UNSET}, this parameter is ignored and the - * position is not reset at all. - * @throws IllegalSeekPositionException If the provided {@code startWindowIndex} is not within the + * C#TIME_UNSET} is passed, the default position of the given {@link MediaItem} is used. In + * any case, if {@code startIndex} is set to {@link C#INDEX_UNSET}, this parameter is ignored + * and the position is not reset at all. + * @throws IllegalSeekPositionException If the provided {@code startIndex} is not within the * bounds of the list of media items. */ - void setMediaItems(List mediaItems, int startWindowIndex, long startPositionMs); + void setMediaItems(List mediaItems, int startIndex, long startPositionMs); /** * Clears the playlist, adds the specified {@link MediaItem} and resets the position to the @@ -1648,9 +1648,9 @@ public interface Player { * Listener#onAvailableCommandsChanged(Commands)} to get an update when the available commands * change. * - *

Executing a command that is not available (for example, calling {@link #seekToNextWindow()} - * if {@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} is unavailable) will neither throw an exception nor - * generate a {@link #getPlayerError()} player error}. + *

Executing a command that is not available (for example, calling {@link + * #seekToNextMediaItem()} if {@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} is unavailable) will + * neither throw an exception nor generate a {@link #getPlayerError()} player error}. * *

{@link #COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM} and {@link #COMMAND_SEEK_TO_NEXT_MEDIA_ITEM} * are unavailable if there is no such {@link MediaItem}. @@ -1755,14 +1755,14 @@ public interface Player { int getRepeatMode(); /** - * Sets whether shuffling of windows is enabled. + * Sets whether shuffling of media items is enabled. * * @param shuffleModeEnabled Whether shuffling is enabled. */ void setShuffleModeEnabled(boolean shuffleModeEnabled); /** - * Returns whether shuffling of windows is enabled. + * Returns whether shuffling of media items is enabled. * * @see Listener#onShuffleModeEnabledChanged(boolean) */ @@ -1777,42 +1777,42 @@ public interface Player { boolean isLoading(); /** - * Seeks to the default position associated with the current window. The position can depend on - * the type of media being played. For live streams it will typically be the live edge of the - * window. For other streams it will typically be the start of the window. + * Seeks to the default position associated with the current {@link MediaItem}. The position can + * depend on the type of media being played. For live streams it will typically be the live edge. + * For other streams it will typically be the start. */ void seekToDefaultPosition(); /** - * Seeks to the default position associated with the specified window. The position can depend on - * the type of media being played. For live streams it will typically be the live edge of the - * window. For other streams it will typically be the start of the window. + * Seeks to the default position associated with the specified {@link MediaItem}. The position can + * depend on the type of media being played. For live streams it will typically be the live edge. + * For other streams it will typically be the start. * - * @param windowIndex The index of the window whose associated default position should be seeked - * to. + * @param mediaItemIndex The index of the {@link MediaItem} whose associated default position + * should be seeked to. * @throws IllegalSeekPositionException If the player has a non-empty timeline and the provided - * {@code windowIndex} is not within the bounds of the current timeline. + * {@code mediaItemIndex} is not within the bounds of the current timeline. */ - void seekToDefaultPosition(int windowIndex); + void seekToDefaultPosition(int mediaItemIndex); /** - * Seeks to a position specified in milliseconds in the current window. + * Seeks to a position specified in milliseconds in the current {@link MediaItem}. * - * @param positionMs The seek position in the current window, or {@link C#TIME_UNSET} to seek to - * the window's default position. + * @param positionMs The seek position in the current {@link MediaItem}, or {@link C#TIME_UNSET} + * to seek to the media item's default position. */ void seekTo(long positionMs); /** - * Seeks to a position specified in milliseconds in the specified window. + * Seeks to a position specified in milliseconds in the specified {@link MediaItem}. * - * @param windowIndex The index of the window. - * @param positionMs The seek position in the specified window, or {@link C#TIME_UNSET} to seek to - * the window's default position. + * @param mediaItemIndex The index of the {@link MediaItem}. + * @param positionMs The seek position in the specified {@link MediaItem}, or {@link C#TIME_UNSET} + * to seek to the media item's default position. * @throws IllegalSeekPositionException If the player has a non-empty timeline and the provided - * {@code windowIndex} is not within the bounds of the current timeline. + * {@code mediaItemIndex} is not within the bounds of the current timeline. */ - void seekTo(int windowIndex, long positionMs); + void seekTo(int mediaItemIndex, long positionMs); /** * Returns the {@link #seekBack()} increment. @@ -1822,7 +1822,9 @@ public interface Player { */ long getSeekBackIncrement(); - /** Seeks back in the current window by {@link #getSeekBackIncrement()} milliseconds. */ + /** + * Seeks back in the current {@link MediaItem} by {@link #getSeekBackIncrement()} milliseconds. + */ void seekBack(); /** @@ -1833,7 +1835,10 @@ public interface Player { */ long getSeekForwardIncrement(); - /** Seeks forward in the current window by {@link #getSeekForwardIncrement()} milliseconds. */ + /** + * Seeks forward in the current {@link MediaItem} by {@link #getSeekForwardIncrement()} + * milliseconds. + */ void seekForward(); /** @deprecated Use {@link #hasPreviousMediaItem()} instead. */ @@ -1919,8 +1924,8 @@ public interface Player { boolean hasNextWindow(); /** - * Returns whether a next window exists, which may depend on the current repeat mode and whether - * shuffle mode is enabled. + * Returns whether a next {@link MediaItem} exists, which may depend on the current repeat mode + * and whether shuffle mode is enabled. * *

Note: When the repeat mode is {@link #REPEAT_MODE_ONE}, this method behaves the same as when * the current repeat mode is {@link #REPEAT_MODE_OFF}. See {@link #REPEAT_MODE_ONE} for more @@ -1939,9 +1944,9 @@ public interface Player { void seekToNextWindow(); /** - * Seeks to the default position of the next window, which may depend on the current repeat mode - * and whether shuffle mode is enabled. Does nothing if {@link #hasNextMediaItem()} is {@code - * false}. + * Seeks to the default position of the next {@link MediaItem}, which may depend on the current + * repeat mode and whether shuffle mode is enabled. Does nothing if {@link #hasNextMediaItem()} is + * {@code false}. * *

Note: When the repeat mode is {@link #REPEAT_MODE_ONE}, this method behaves the same as when * the current repeat mode is {@link #REPEAT_MODE_OFF}. See {@link #REPEAT_MODE_ONE} for more @@ -1957,8 +1962,8 @@ public interface Player { *

  • If the timeline is empty or seeking is not possible, does nothing. *
  • Otherwise, if {@link #hasNextMediaItem() a next media item exists}, seeks to the default * position of the next {@link MediaItem}. - *
  • Otherwise, if the current window is {@link #isCurrentMediaItemLive() live} and has not - * ended, seeks to the live edge of the current {@link MediaItem}. + *
  • Otherwise, if the current {@link MediaItem} is {@link #isCurrentMediaItemLive() live} and + * has not ended, seeks to the live edge of the current {@link MediaItem}. *
  • Otherwise, does nothing. * */ diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImpl.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImpl.java index d357e6e326..13e225d5dd 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImpl.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayerImpl.java @@ -421,9 +421,8 @@ import java.util.concurrent.CopyOnWriteArraySet; } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { - setMediaSources(createMediaSources(mediaItems), startWindowIndex, startPositionMs); + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { + setMediaSources(createMediaSources(mediaItems), startIndex, startPositionMs); } public void setMediaSource(MediaSource mediaSource) { @@ -655,10 +654,11 @@ import java.util.concurrent.CopyOnWriteArraySet; } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { Timeline timeline = playbackInfo.timeline; - if (windowIndex < 0 || (!timeline.isEmpty() && windowIndex >= timeline.getWindowCount())) { - throw new IllegalSeekPositionException(timeline, windowIndex, positionMs); + if (mediaItemIndex < 0 + || (!timeline.isEmpty() && mediaItemIndex >= timeline.getWindowCount())) { + throw new IllegalSeekPositionException(timeline, mediaItemIndex, positionMs); } pendingOperationAcks++; if (isPlayingAd()) { @@ -681,8 +681,8 @@ import java.util.concurrent.CopyOnWriteArraySet; maskTimelineAndPosition( newPlaybackInfo, timeline, - getPeriodPositionOrMaskWindowPosition(timeline, windowIndex, positionMs)); - internalPlayer.seekTo(timeline, windowIndex, C.msToUs(positionMs)); + getPeriodPositionOrMaskWindowPosition(timeline, mediaItemIndex, positionMs)); + internalPlayer.seekTo(timeline, mediaItemIndex, C.msToUs(positionMs)); updatePlaybackInfo( newPlaybackInfo, /* ignored */ TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED, diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/SimpleExoPlayer.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/SimpleExoPlayer.java index b79fe91b59..808f437a44 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/SimpleExoPlayer.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/SimpleExoPlayer.java @@ -1097,10 +1097,9 @@ public class SimpleExoPlayer extends BasePlayer } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { verifyApplicationThread(); - player.setMediaItems(mediaItems, startWindowIndex, startPositionMs); + player.setMediaItems(mediaItems, startIndex, startPositionMs); } @Override @@ -1246,10 +1245,10 @@ public class SimpleExoPlayer extends BasePlayer } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { verifyApplicationThread(); analyticsCollector.notifySeekStarted(); - player.seekTo(windowIndex, positionMs); + player.seekTo(mediaItemIndex, positionMs); } @Override diff --git a/libraries/session/src/main/java/androidx/media3/session/MediaController.java b/libraries/session/src/main/java/androidx/media3/session/MediaController.java index abe16f9a6e..ab9d4b5265 100644 --- a/libraries/session/src/main/java/androidx/media3/session/MediaController.java +++ b/libraries/session/src/main/java/androidx/media3/session/MediaController.java @@ -520,13 +520,13 @@ public class MediaController implements Player { } @Override - public void seekToDefaultPosition(int windowIndex) { + public void seekToDefaultPosition(int mediaItemIndex) { verifyApplicationThread(); if (!isConnected()) { Log.w(TAG, "The controller is not connected. Ignoring seekTo()."); return; } - impl.seekToDefaultPosition(windowIndex); + impl.seekToDefaultPosition(mediaItemIndex); } @Override @@ -540,13 +540,13 @@ public class MediaController implements Player { } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { verifyApplicationThread(); if (!isConnected()) { Log.w(TAG, "The controller is not connected. Ignoring seekTo()."); return; } - impl.seekTo(windowIndex, positionMs); + impl.seekTo(mediaItemIndex, positionMs); } /** @@ -946,8 +946,7 @@ public class MediaController implements Player { } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { verifyApplicationThread(); checkNotNull(mediaItems, "mediaItems must not be null"); for (int i = 0; i < mediaItems.size(); i++) { @@ -957,7 +956,7 @@ public class MediaController implements Player { Log.w(TAG, "The controller is not connected. Ignoring setMediaItems()."); return; } - impl.setMediaItems(mediaItems, startWindowIndex, startPositionMs); + impl.setMediaItems(mediaItems, startIndex, startPositionMs); } /** @@ -1287,7 +1286,7 @@ public class MediaController implements Player { * *

    Interoperability: When connected to {@link * android.support.v4.media.session.MediaSessionCompat}, this will always return {@link - * C#INDEX_UNSET} even when {@link #hasPreviousWindow()} is {@code true}. + * C#INDEX_UNSET} even when {@link #hasPreviousMediaItem()} is {@code true}. */ @Override public int getPreviousMediaItemIndex() { @@ -1308,7 +1307,7 @@ public class MediaController implements Player { * *

    Interoperability: When connected to {@link * android.support.v4.media.session.MediaSessionCompat}, this will always return {@link - * C#INDEX_UNSET} even when {@link #hasNextWindow()} is {@code true}. + * C#INDEX_UNSET} even when {@link #hasNextMediaItem()} is {@code true}. */ @Override public int getNextMediaItemIndex() { @@ -1424,8 +1423,8 @@ public class MediaController implements Player { * {@inheritDoc} * *

    Interoperability: When connected to {@link - * android.support.v4.media.session.MediaSessionCompat}, it wouldn't update current window index - * immediately because previous window index is unknown. + * android.support.v4.media.session.MediaSessionCompat}, it won't update the current media item + * index immediately because the previous media item index is unknown. */ @Override public void seekToPrevious() { @@ -1453,8 +1452,8 @@ public class MediaController implements Player { * {@inheritDoc} * *

    Interoperability: When connected to {@link - * android.support.v4.media.session.MediaSessionCompat}, it wouldn't update current window index - * immediately because previous window index is unknown. + * android.support.v4.media.session.MediaSessionCompat}, it won't update the current media item + * index immediately because the previous media item index is unknown. */ @Override public void seekToNext() { diff --git a/libraries/session/src/main/java/androidx/media3/session/PlayerWrapper.java b/libraries/session/src/main/java/androidx/media3/session/PlayerWrapper.java index 2aa86130c2..bf4c45b38f 100644 --- a/libraries/session/src/main/java/androidx/media3/session/PlayerWrapper.java +++ b/libraries/session/src/main/java/androidx/media3/session/PlayerWrapper.java @@ -106,9 +106,9 @@ import java.util.List; } @Override - public void seekToDefaultPosition(int windowIndex) { + public void seekToDefaultPosition(int mediaItemIndex) { verifyApplicationThread(); - super.seekToDefaultPosition(windowIndex); + super.seekToDefaultPosition(mediaItemIndex); } @Override @@ -118,9 +118,9 @@ import java.util.List; } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { verifyApplicationThread(); - super.seekTo(windowIndex, positionMs); + super.seekTo(mediaItemIndex, positionMs); } @Override @@ -334,10 +334,9 @@ import java.util.List; } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { verifyApplicationThread(); - super.setMediaItems(mediaItems, startWindowIndex, startPositionMs); + super.setMediaItems(mediaItems, startIndex, startPositionMs); } @Override diff --git a/libraries/test_session_current/src/main/java/androidx/media3/session/MockPlayer.java b/libraries/test_session_current/src/main/java/androidx/media3/session/MockPlayer.java index ba7c69dc99..7425c69984 100644 --- a/libraries/test_session_current/src/main/java/androidx/media3/session/MockPlayer.java +++ b/libraries/test_session_current/src/main/java/androidx/media3/session/MockPlayer.java @@ -270,9 +270,9 @@ public class MockPlayer implements Player { } @Override - public void seekToDefaultPosition(int windowIndex) { + public void seekToDefaultPosition(int mediaItemIndex) { seekToDefaultPositionWithWindowIndexCalled = true; - seekWindowIndex = windowIndex; + seekWindowIndex = mediaItemIndex; countDownLatch.countDown(); } @@ -284,9 +284,9 @@ public class MockPlayer implements Player { } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { seekToWithWindowIndexCalled = true; - seekWindowIndex = windowIndex; + seekWindowIndex = mediaItemIndex; seekPositionMs = positionMs; countDownLatch.countDown(); } @@ -665,11 +665,10 @@ public class MockPlayer implements Player { } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { setMediaItemsWithStartWindowIndexCalled = true; this.mediaItems = mediaItems; - this.startWindowIndex = startWindowIndex; + this.startWindowIndex = startIndex; this.startPositionMs = startPositionMs; countDownLatch.countDown(); } diff --git a/libraries/test_utils/src/main/java/androidx/media3/test/utils/StubExoPlayer.java b/libraries/test_utils/src/main/java/androidx/media3/test/utils/StubExoPlayer.java index 4199cd053c..3fb1592539 100644 --- a/libraries/test_utils/src/main/java/androidx/media3/test/utils/StubExoPlayer.java +++ b/libraries/test_utils/src/main/java/androidx/media3/test/utils/StubExoPlayer.java @@ -208,8 +208,7 @@ public class StubExoPlayer extends BasePlayer implements ExoPlayer { } @Override - public void setMediaItems( - List mediaItems, int startWindowIndex, long startPositionMs) { + public void setMediaItems(List mediaItems, int startIndex, long startPositionMs) { throw new UnsupportedOperationException(); } @@ -400,7 +399,7 @@ public class StubExoPlayer extends BasePlayer implements ExoPlayer { } @Override - public void seekTo(int windowIndex, long positionMs) { + public void seekTo(int mediaItemIndex, long positionMs) { throw new UnsupportedOperationException(); }