diff --git a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt index c80636795..200cdf81f 100644 --- a/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/fragments/PlayerFragment.kt @@ -165,6 +165,7 @@ class PlayerFragment : BaseFragment() { private var sponsorBlockEnabled = true private var sponsorBlockNotifications = true private var skipButtonsEnabled = false + private var pipEnabled = true /** * for autoplay @@ -328,6 +329,11 @@ class PlayerFragment : BaseFragment() { PreferenceKeys.SKIP_BUTTONS, false ) + + pipEnabled = PreferenceHelper.getBoolean( + PreferenceKeys.PICTURE_IN_PICTURE, + true + ) } private fun initializeTransitionLayout() { @@ -1629,11 +1635,6 @@ class PlayerFragment : BaseFragment() { } private fun shouldStartPiP(): Boolean { - val pipEnabled = PreferenceHelper.getBoolean( - PreferenceKeys.PICTURE_IN_PICTURE, - true - ) - if (!pipEnabled) return false val bounds = Rect()