Don't kill the app when closing through PiP

This commit is contained in:
Bnyro 2023-01-27 16:29:59 +01:00
parent 9ec166dcef
commit a3e0c40a0f

View File

@ -1439,10 +1439,8 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
updateCaptionsLanguage(null) updateCaptionsLanguage(null)
} else if (lifecycle.currentState == Lifecycle.State.CREATED) { } else if (lifecycle.currentState == Lifecycle.State.CREATED) {
// close button got clicked in PiP mode // close button got clicked in PiP mode
// destroying the fragment, player and notification // pause the video and keep the app alive
onDestroy() exoPlayer.pause()
// finish the activity
activity?.finishAndRemoveTask()
} else { } else {
// enable exoPlayer controls again // enable exoPlayer controls again
exoPlayerView.useController = true exoPlayerView.useController = true