mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-08-31 06:35:19 +00:00
Fix fullscreen eliciting "clear queue" prompt
This commit is contained in:
@@ -159,6 +159,11 @@ public final class PlayerHolder {
|
|||||||
|
|
||||||
private boolean playAfterConnect = false;
|
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) {
|
public void doPlayAfterConnect(final boolean playAfterConnection) {
|
||||||
this.playAfterConnect = playAfterConnection;
|
this.playAfterConnect = playAfterConnection;
|
||||||
}
|
}
|
||||||
@@ -183,7 +188,6 @@ public final class PlayerHolder {
|
|||||||
playerService = localBinder.getService();
|
playerService = localBinder.getService();
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
listener.onServiceConnected(playerService);
|
listener.onServiceConnected(playerService);
|
||||||
getPlayer().ifPresent(p -> listener.onPlayerConnected(p, playAfterConnect));
|
|
||||||
}
|
}
|
||||||
startPlayerListener();
|
startPlayerListener();
|
||||||
// ^ will call listener.onPlayerConnected() down the line if there is an active player
|
// ^ will call listener.onPlayerConnected() down the line if there is an active player
|
||||||
@@ -357,6 +361,8 @@ public final class PlayerHolder {
|
|||||||
listener.onPlayerDisconnected();
|
listener.onPlayerDisconnected();
|
||||||
} else {
|
} else {
|
||||||
listener.onPlayerConnected(player, serviceConnection.playAfterConnect);
|
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);
|
player.setFragmentListener(internalListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user