mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
small improvements
This commit is contained in:
parent
73beffef22
commit
e0147cbaad
@ -285,11 +285,13 @@ class PlayerFragment : Fragment() {
|
|||||||
|
|
||||||
val mainActivity = activity as MainActivity
|
val mainActivity = activity as MainActivity
|
||||||
val fullscreenOrientationPref = PreferenceHelper
|
val fullscreenOrientationPref = PreferenceHelper
|
||||||
.getString(requireContext(), "fullscreen_rotation", "ratio")
|
.getString(requireContext(), "fullscreen_orientation", "ratio")
|
||||||
|
Log.e(TAG, fullscreenOrientationPref.toString())
|
||||||
val orientation = when (fullscreenOrientationPref) {
|
val orientation = when (fullscreenOrientationPref) {
|
||||||
"ratio" -> {
|
"ratio" -> {
|
||||||
val videoSize = exoPlayer.videoSize
|
val videoSize = exoPlayer.videoSize
|
||||||
// probably a youtube shorts video
|
// probably a youtube shorts video
|
||||||
|
Log.e(TAG, videoSize.height.toString() + " " + videoSize.width.toString())
|
||||||
if (videoSize.height > videoSize.width) ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
if (videoSize.height > videoSize.width) ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||||
// a video with normal aspect ratio
|
// a video with normal aspect ratio
|
||||||
else ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
else ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||||
@ -299,7 +301,7 @@ class PlayerFragment : Fragment() {
|
|||||||
"portrait" -> ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
"portrait" -> ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||||
else -> ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
else -> ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE
|
||||||
}
|
}
|
||||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
mainActivity.requestedOrientation = orientation
|
||||||
} else {
|
} else {
|
||||||
// leave fullscreen mode
|
// leave fullscreen mode
|
||||||
with(binding.playerMotionLayout) {
|
with(binding.playerMotionLayout) {
|
||||||
|
Loading…
Reference in New Issue
Block a user