Skip to content

Commit 74ab7ef

Browse files
Add release notes
1 parent a1eb756 commit 74ab7ef

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

RELEASENOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* ExoPlayer:
1212
* Ensure renderers don't consume data from the next playlist item more
1313
than 10 seconds before the end of the current item.
14+
* Add getter for shuffle mode to the `ExoPlayer` interface
15+
([#2522](https://github.com/androidx/media/pull/2522)).
1416
* Transformer:
1517
* Track Selection:
1618
* Extractors:

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/ExoPlayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1382,7 +1382,7 @@ void setMediaSources(
13821382
void setShuffleOrder(ShuffleOrder shuffleOrder);
13831383

13841384
/**
1385-
* Gets the shuffle order.
1385+
* Returns the shuffle order.
13861386
*
13871387
* <p>The {@link ShuffleOrder} returned will have the same length as the current playlist ({@link
13881388
* Player#getMediaItemCount()}).

libraries/exoplayer/src/test/java/androidx/media3/exoplayer/ExoPlayerTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8132,15 +8132,18 @@ public void run(ExoPlayer player) {
81328132
@Test
81338133
public void setShuffleOrder_keepsCurrentPosition() throws Exception {
81348134
AtomicLong positionAfterSetShuffleOrder = new AtomicLong(C.TIME_UNSET);
8135+
AtomicReference<ShuffleOrder> shuffleOrderRef = new AtomicReference<>();
8136+
FakeShuffleOrder shuffleOrder = new FakeShuffleOrder(/* length= */ 1);
81358137
ActionSchedule actionSchedule =
81368138
new ActionSchedule.Builder(TAG)
81378139
.playUntilPosition(0, 5000)
8138-
.setShuffleOrder(new FakeShuffleOrder(/* length= */ 1))
8140+
.setShuffleOrder(shuffleOrder)
81398141
.executeRunnable(
81408142
new PlayerRunnable() {
81418143
@Override
81428144
public void run(ExoPlayer player) {
81438145
positionAfterSetShuffleOrder.set(player.getCurrentPosition());
8146+
shuffleOrderRef.set(player.getShuffleOrder());
81448147
}
81458148
})
81468149
.play()
@@ -8152,6 +8155,7 @@ public void run(ExoPlayer player) {
81528155
.blockUntilEnded(TIMEOUT_MS);
81538156

81548157
assertThat(positionAfterSetShuffleOrder.get()).isAtLeast(5000);
8158+
assertThat(shuffleOrderRef.get()).isEqualTo(shuffleOrder);
81558159
}
81568160

81578161
@Test

0 commit comments

Comments
 (0)