Skip to content

Commit 5cc94e5

Browse files
committed
player: seek to new index when given a new playqueue with a different index
This happens in the MediaBrowserServiceCompat flow (playing a playlist).
1 parent d26b092 commit 5cc94e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,10 @@ public void handleIntent(@NonNull final Intent intent) {
414414
== com.google.android.exoplayer2.Player.STATE_IDLE) {
415415
simpleExoPlayer.prepare();
416416
}
417+
if (playQueue.getIndex() != newQueue.getIndex()) {
418+
simpleExoPlayer.seekTo(newQueue.getIndex(),
419+
newQueue.getItem().getRecoveryPosition());
420+
}
417421
simpleExoPlayer.setPlayWhenReady(playWhenReady);
418422

419423
} else if (intent.getBooleanExtra(RESUME_PLAYBACK, false)

0 commit comments

Comments
 (0)