[Android] Fix default orientation when a video is played while the device is in portrait mode

Nicolas Pomepuy git at videolan.org
Wed Dec 2 07:30:39 CET 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed Dec  2 07:27:12 2020 +0100| [1664711fbeafd4e0c1de7a7a28f9a5dd698c7cef] | committer: Nicolas Pomepuy

Fix default orientation when a video is played while the device is in portrait mode

Fixes #1489

> https://code.videolan.org/videolan/vlc-android/commit/1664711fbeafd4e0c1de7a7a28f9a5dd698c7cef
---

 .../vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
index cc0cba819..8cfb73bad 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.kt
@@ -396,7 +396,7 @@ open class VideoPlayerActivity : AppCompatActivity(), PlaybackService.Callback,
         val screenOrientationSetting = Integer.valueOf(settings.getString(SCREEN_ORIENTATION, "99" /*SCREEN ORIENTATION SENSOR*/)!!)
         orientationMode = when (screenOrientationSetting) {
             99 -> PlayerOrientationMode(false)
-            101 -> PlayerOrientationMode(true, if (windowManager.defaultDisplay.rotation == Surface.ROTATION_90) ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE else ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE)
+            101 -> PlayerOrientationMode(true, if (windowManager.defaultDisplay.rotation == Surface.ROTATION_270) ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE else ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
             102 -> PlayerOrientationMode(true, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
             else -> PlayerOrientationMode(true, getOrientationForLock())
         }



More information about the Android mailing list