Skip to content

Commit

Permalink
Merge pull request #6981 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: crash when rotating phone while player session not yet started
  • Loading branch information
Bnyro authored Jan 17, 2025
2 parents 5306834 + da6a9b7 commit 2b22bdc
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1495,15 +1495,12 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
val orientation = resources.configuration.orientation
if (commonPlayerViewModel.isFullscreen.value != true && orientation != playerLayoutOrientation) {
// remember the current position before recreating the activity
arguments?.putLong(
IntentData.timeStamp,
playerController.currentPosition / 1000
)
playerLayoutOrientation = orientation

viewModel.isOrientationChangeInProgress = true

playerController.release()
if (::playerController.isInitialized) playerController.release()

activity?.recreate()
}
}
Expand Down

0 comments on commit 2b22bdc

Please sign in to comment.