1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-08-29 09:02:19 +00:00

Fix fullscreen eliciting "clear queue" prompt

This commit is contained in:
Stypox
2025-07-07 15:07:46 +02:00
parent 2dd11f70a3
commit 79084568f2

View File

@@ -159,6 +159,11 @@ public final class PlayerHolder {
private boolean playAfterConnect = false;
/**
* @param playAfterConnection Sets the value of `playAfterConnect` to pass to the {@link
* PlayerServiceExtendedEventListener#onPlayerConnected(Player, boolean)} the next time it
* is called. The value of `playAfterConnect` will be reset to false after that.
*/
public void doPlayAfterConnect(final boolean playAfterConnection) {
this.playAfterConnect = playAfterConnection;
}
@@ -183,7 +188,6 @@ public final class PlayerHolder {
playerService = localBinder.getService();
if (listener != null) {
listener.onServiceConnected(playerService);
getPlayer().ifPresent(p -> listener.onPlayerConnected(p, playAfterConnect));
}
startPlayerListener();
// ^ will call listener.onPlayerConnected() down the line if there is an active player
@@ -357,6 +361,8 @@ public final class PlayerHolder {
listener.onPlayerDisconnected();
} else {
listener.onPlayerConnected(player, serviceConnection.playAfterConnect);
// reset the value of playAfterConnect: if it was true before, it is now "consumed"
serviceConnection.playAfterConnect = false;
player.setFragmentListener(internalListener);
}
}