mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
Merge pull request #6981 from Bnyro/master
fix: crash when rotating phone while player session not yet started
This commit is contained in:
commit
2b22bdcdbc
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user