From 34ab93c9bd214c02882386db09392e02b59b0540 Mon Sep 17 00:00:00 2001 From: ktprograms Date: Mon, 1 Nov 2021 11:48:20 +0800 Subject: [PATCH] Fix player controls not hiding if resumed from media button --- app/src/main/java/org/schabi/newpipe/player/Player.java | 3 +++ .../org/schabi/newpipe/player/playback/PlayerMediaSession.java | 1 + 2 files changed, 4 insertions(+) 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 22e66e793..4e2a9d065 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -3754,6 +3754,9 @@ public final class Player implements case KeyEvent.KEYCODE_SPACE: if (isFullscreen) { playPause(); + if (isPlaying()) { + hideControls(0, 0); + } } break; case KeyEvent.KEYCODE_BACK: diff --git a/app/src/main/java/org/schabi/newpipe/player/playback/PlayerMediaSession.java b/app/src/main/java/org/schabi/newpipe/player/playback/PlayerMediaSession.java index 9dcb12344..fbe12efb1 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playback/PlayerMediaSession.java +++ b/app/src/main/java/org/schabi/newpipe/player/playback/PlayerMediaSession.java @@ -88,6 +88,7 @@ public class PlayerMediaSession implements MediaSessionCallback { @Override public void play() { player.play(); + player.hideControls(0, 0); } @Override