Skip to content

Commit 0aa2266

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 8ab2727 commit 0aa2266

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
@@ -388,6 +388,10 @@ public void handleIntent(@NonNull final Intent intent) {
388388
== com.google.android.exoplayer2.Player.STATE_IDLE) {
389389
simpleExoPlayer.prepare();
390390
}
391+
if (playQueue.getIndex() != newQueue.getIndex()) {
392+
simpleExoPlayer.seekTo(newQueue.getIndex(),
393+
newQueue.getItem().getRecoveryPosition());
394+
}
391395
simpleExoPlayer.setPlayWhenReady(playWhenReady);
392396

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

0 commit comments

Comments
 (0)