From 55417a76b226e92ce0506c50fa7d753ef807776a Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 8 Dec 2022 18:27:41 +0100 Subject: [PATCH] pause the player when PiP is disabled --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index e8d168399..5bce4ee4e 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -1392,7 +1392,9 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { fun onUserLeaveHint() { if (usePiP() && shouldStartPiP()) { activity?.enterPictureInPictureMode(getPipParams()) + return } + if (!PlayerHelper.pipEnabled) exoPlayer.pause() } @RequiresApi(Build.VERSION_CODES.O)