mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Merge pull request #2880 from Bnyro/master
Don't kill the app when closing through PiP
This commit is contained in:
commit
326df3970a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user