From c83a8ee1b7e1a7c3cc50fbf422d3be3d7ab722b6 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 5 Aug 2023 10:25:19 +0200 Subject: [PATCH] fix: crash when pip not supported --- .../github/libretube/ui/fragments/PlayerFragment.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 2130613a8..09cd1974f 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 @@ -622,10 +622,12 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { // disable the auto PiP mode for SDK >= 32 exoPlayer.pause() - PictureInPictureCompat.setPictureInPictureParams( - requireActivity(), - pipParams - ) + if (PlayerHelper.pipEnabled) { + PictureInPictureCompat.setPictureInPictureParams( + requireActivity(), + pipParams + ) + } handler.removeCallbacksAndMessages(null)