mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
fix: auto rotation stops working after having entered the fullscreen player
This commit is contained in:
parent
33e2b87bbc
commit
3346c7c774
@ -705,22 +705,14 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewModel.isFullscreen.value = false
|
viewModel.isFullscreen.value = false
|
||||||
|
|
||||||
if (
|
|
||||||
!PlayerHelper.autoFullscreenEnabled &&
|
|
||||||
mainActivity.screenOrientationPref == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
|
||||||
) {
|
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
|
||||||
}
|
|
||||||
|
|
||||||
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
playerBinding.fullscreen.setImageResource(R.drawable.ic_fullscreen)
|
||||||
playerBinding.exoTitle.isInvisible = true
|
playerBinding.exoTitle.isInvisible = true
|
||||||
|
|
||||||
|
mainActivity.requestedOrientation = mainActivity.screenOrientationPref
|
||||||
|
openOrCloseFullscreenDialog(false)
|
||||||
updateResolutionOnFullscreenChange(false)
|
updateResolutionOnFullscreenChange(false)
|
||||||
|
|
||||||
openOrCloseFullscreenDialog(false)
|
restartActivityIfNeeded()
|
||||||
|
|
||||||
checkForNecessaryOrientationRestart()
|
|
||||||
|
|
||||||
binding.player.updateMarginsByFullscreenMode()
|
binding.player.updateMarginsByFullscreenMode()
|
||||||
}
|
}
|
||||||
@ -1657,7 +1649,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
* Check if the activity needs to be recreated due to an orientation change
|
* Check if the activity needs to be recreated due to an orientation change
|
||||||
* If true, the activity will be automatically restarted
|
* If true, the activity will be automatically restarted
|
||||||
*/
|
*/
|
||||||
private fun checkForNecessaryOrientationRestart() {
|
private fun restartActivityIfNeeded() {
|
||||||
val lockedOrientations =
|
val lockedOrientations =
|
||||||
listOf(
|
listOf(
|
||||||
ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT,
|
ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT,
|
||||||
@ -1696,7 +1688,7 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
else -> unsetFullscreen()
|
else -> unsetFullscreen()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
checkForNecessaryOrientationRestart()
|
restartActivityIfNeeded()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user