From 0b40039e964e9a0e1d26e0199977ff18e00912b3 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sun, 17 Sep 2023 15:24:28 +0200 Subject: [PATCH] fix: crash when the app was closed for a while --- .../java/com/github/libretube/ui/fragments/PlayerFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 d44b756f3..4ba138396 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 @@ -639,8 +639,9 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { viewModel.player = null + if (this::exoPlayer.isInitialized) exoPlayer.pause() + // disable the auto PiP mode for SDK >= 32 - exoPlayer.pause() if (PlayerHelper.pipEnabled) { PictureInPictureCompat.setPictureInPictureParams( requireActivity(),