From ea07d7751b7aabc2887adca98bc9f3a659747e5d 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(); }