Merge pull request #6981 from Bnyro/master

fix: crash when rotating phone while player session not yet started
This commit is contained in:
Bnyro 2025-01-17 18:37:41 +01:00 committed by GitHub
commit 2b22bdcdbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()
}
}