fix: crash when rotating phone while player session not yet started

This commit is contained in:
Bnyro 2025-01-17 18:37:21 +01:00
parent 5306834560
commit da6a9b7547

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