mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +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
|
val orientation = resources.configuration.orientation
|
||||||
if (commonPlayerViewModel.isFullscreen.value != true && orientation != playerLayoutOrientation) {
|
if (commonPlayerViewModel.isFullscreen.value != true && orientation != playerLayoutOrientation) {
|
||||||
// remember the current position before recreating the activity
|
// remember the current position before recreating the activity
|
||||||
arguments?.putLong(
|
|
||||||
IntentData.timeStamp,
|
|
||||||
playerController.currentPosition / 1000
|
|
||||||
)
|
|
||||||
playerLayoutOrientation = orientation
|
playerLayoutOrientation = orientation
|
||||||
|
|
||||||
viewModel.isOrientationChangeInProgress = true
|
viewModel.isOrientationChangeInProgress = true
|
||||||
|
|
||||||
playerController.release()
|
if (::playerController.isInitialized) playerController.release()
|
||||||
|
|
||||||
activity?.recreate()
|
activity?.recreate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user