mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-05-05 17:04:08 +00:00
Fix style and add comment about null player
This commit is contained in:
parent
a7a7dc5363
commit
49b71942ad
@ -319,13 +319,10 @@ public final class PlayerService extends MediaBrowserServiceCompat {
|
|||||||
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
|
public void setPlayerListener(@Nullable final Consumer<Player> listener) {
|
||||||
this.onPlayerStartedOrStopped = listener;
|
this.onPlayerStartedOrStopped = listener;
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
if (player == null) {
|
// if there is no player, then `null` will be sent here, to ensure the state is synced
|
||||||
listener.accept(null);
|
|
||||||
} else {
|
|
||||||
listener.accept(player);
|
listener.accept(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
//region Media browser
|
//region Media browser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user