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 8d4d938db..bf6a81887 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 @@ -1433,13 +1433,11 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { viewModel.isFullscreen.value = false updateCaptionsLanguage(null) - } else if (lifecycle.currentState == Lifecycle.State.CREATED) { - // close button got clicked in PiP mode - // destroying the fragment, player and notification - onDestroy() - // finish the activity - activity?.finishAndRemoveTask() } else { + // close button got clicked in PiP mode + // pause the video and keep the app alive + if (lifecycle.currentState == Lifecycle.State.CREATED) exoPlayer.pause() + // enable exoPlayer controls again exoPlayerView.useController = true