Skip to content

Commit

Permalink
Merge pull request #2880 from Bnyro/master
Browse files Browse the repository at this point in the history
Don't kill the app when closing through PiP
  • Loading branch information
Bnyro authored Jan 27, 2023
2 parents 378dc13 + 34c0d8d commit 326df39
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 326df39

Please sign in to comment.