From e83d964fca39cd490abb27e7c03cbe9cc3ecf262 Mon Sep 17 00:00:00 2001 From: TiA4f8R <74829229+TiA4f8R@users.noreply.github.com> Date: Sun, 23 Jan 2022 22:53:17 +0100 Subject: [PATCH] Fix first item played in playlists when switching player type or resolution The issue was caused by an ExoPlayer change, which when setting a media source, resets the current playback position and the current window index by default. Also set player recovery in more places to fix playback position not propely set in some cases after a player type switch. --- app/src/main/java/org/schabi/newpipe/player/Player.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 81ef25db1..43533b52e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -2048,7 +2048,7 @@ public final class Player implements if (currentState == STATE_BLOCKED) { changeState(STATE_BUFFERING); } - simpleExoPlayer.setMediaSource(mediaSource); + simpleExoPlayer.setMediaSource(mediaSource, false); simpleExoPlayer.prepare(); }