mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
fix: crash when player fragment is being destroyed
This commit is contained in:
parent
bdd15e0304
commit
82a278792a
@ -779,16 +779,16 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
|
||||
if (viewModel.player == exoPlayer) viewModel.player = null
|
||||
if (this::exoPlayer.isInitialized) {
|
||||
if (viewModel.player == exoPlayer) viewModel.player = null
|
||||
|
||||
if (this::exoPlayer.isInitialized) exoPlayer.pause()
|
||||
exoPlayer.pause()
|
||||
|
||||
// disable the auto PiP mode for SDK >= 32
|
||||
if (PlayerHelper.pipEnabled) {
|
||||
PictureInPictureCompat.setPictureInPictureParams(
|
||||
requireActivity(),
|
||||
pipParams
|
||||
)
|
||||
if (PlayerHelper.pipEnabled) {
|
||||
// disable the auto PiP mode for SDK >= 32
|
||||
PictureInPictureCompat
|
||||
.setPictureInPictureParams(requireActivity(), pipParams)
|
||||
}
|
||||
}
|
||||
|
||||
handler.removeCallbacksAndMessages(null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user