From 61432a2a314dc354b54649336ae746c4eb3c6d65 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 5 May 2025 19:57:08 +0200 Subject: [PATCH] Player/handleIntent: keep current player when clicking timestamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was always a bit weird, that clicking a timestamp would unconditionally switch to the popup player. With the new enum, it’s trivial to change it to always stay at the selected player now ;) --- .../main/java/org/schabi/newpipe/player/Player.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 8d3c4e503..9a5cc50d8 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -124,7 +124,6 @@ import org.schabi.newpipe.util.DependentPreferenceHelper; import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.ListHelper; import org.schabi.newpipe.util.NavigationHelper; -import org.schabi.newpipe.util.PermissionHelper; import org.schabi.newpipe.util.SerializedCache; import org.schabi.newpipe.util.StreamTypeUtil; import org.schabi.newpipe.util.image.PicassoHelper; @@ -364,13 +363,8 @@ public final class Player implements PlaybackListener, Listener { // can move the initUIs stuff without breaking the setup for edge cases somehow. switch (playerIntentType) { case TimestampChange -> { - // TODO: this breaks out of the pattern of asking for the permission before - // sending the PlayerIntent, but I’m not sure yet how to combine the permissions - // with the new enum approach. Maybe it’s better that the player asks anyway? - if (!PermissionHelper.isPopupEnabledElseAsk(context)) { - return; - } - newPlayerType = PlayerType.POPUP; + // when playing from a timestamp, keep the current player as-is. + newPlayerType = playerType; } default -> { newPlayerType = PlayerType.retrieveFromIntent(intent);