Merge pull request #2880 from Bnyro/master

Don't kill the app when closing through PiP
This commit is contained in:
Bnyro 2023-01-27 16:33:10 +01:00 committed by GitHub
commit 326df3970a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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