1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-26 15:13:00 +00:00

Player/handleIntent: keep current player when clicking timestamp

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 ;)
This commit is contained in:
Profpatsch 2025-05-05 19:57:08 +02:00
parent 3dba719d9f
commit 61432a2a31

View File

@ -124,7 +124,6 @@ import org.schabi.newpipe.util.DependentPreferenceHelper;
import org.schabi.newpipe.util.ExtractorHelper; import org.schabi.newpipe.util.ExtractorHelper;
import org.schabi.newpipe.util.ListHelper; import org.schabi.newpipe.util.ListHelper;
import org.schabi.newpipe.util.NavigationHelper; import org.schabi.newpipe.util.NavigationHelper;
import org.schabi.newpipe.util.PermissionHelper;
import org.schabi.newpipe.util.SerializedCache; import org.schabi.newpipe.util.SerializedCache;
import org.schabi.newpipe.util.StreamTypeUtil; import org.schabi.newpipe.util.StreamTypeUtil;
import org.schabi.newpipe.util.image.PicassoHelper; 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. // can move the initUIs stuff without breaking the setup for edge cases somehow.
switch (playerIntentType) { switch (playerIntentType) {
case TimestampChange -> { case TimestampChange -> {
// TODO: this breaks out of the pattern of asking for the permission before // when playing from a timestamp, keep the current player as-is.
// sending the PlayerIntent, but Im not sure yet how to combine the permissions newPlayerType = playerType;
// with the new enum approach. Maybe its better that the player asks anyway?
if (!PermissionHelper.isPopupEnabledElseAsk(context)) {
return;
}
newPlayerType = PlayerType.POPUP;
} }
default -> { default -> {
newPlayerType = PlayerType.retrieveFromIntent(intent); newPlayerType = PlayerType.retrieveFromIntent(intent);