diff --git a/app/src/main/java/com/futo/platformplayer/Settings.kt b/app/src/main/java/com/futo/platformplayer/Settings.kt
index ffb6e3a5..67fa246c 100644
--- a/app/src/main/java/com/futo/platformplayer/Settings.kt
+++ b/app/src/main/java/com/futo/platformplayer/Settings.kt
@@ -478,15 +478,18 @@ class Settings : FragmentedStorageFileJson() {
@DropdownFieldOptionsId(R.array.rotation_zone)
var rotationZone: Int = 2;
- @FormField(R.string.prefer_webm, FieldForm.TOGGLE, R.string.prefer_webm_description, 16)
+ @FormField(R.string.full_autorotate_lock, FieldForm.TOGGLE, R.string.full_autorotate_lock_description, 16)
+ var fullAutorotateLock: Boolean = false;
+
+ @FormField(R.string.prefer_webm, FieldForm.TOGGLE, R.string.prefer_webm_description, 17)
var preferWebmVideo: Boolean = false;
- @FormField(R.string.prefer_webm_audio, FieldForm.TOGGLE, R.string.prefer_webm_audio_description, 17)
+ @FormField(R.string.prefer_webm_audio, FieldForm.TOGGLE, R.string.prefer_webm_audio_description, 18)
var preferWebmAudio: Boolean = false;
- @FormField(R.string.allow_under_cutout, FieldForm.TOGGLE, R.string.allow_under_cutout_description, 18)
+ @FormField(R.string.allow_under_cutout, FieldForm.TOGGLE, R.string.allow_under_cutout_description, 19)
var allowVideoToGoUnderCutout: Boolean = true;
- @FormField(R.string.autoplay, FieldForm.TOGGLE, R.string.autoplay, 19)
+ @FormField(R.string.autoplay, FieldForm.TOGGLE, R.string.autoplay, 20)
var autoplay: Boolean = false;
}
diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt
index b1a498f5..63b2f556 100644
--- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt
+++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailFragment.kt
@@ -97,6 +97,7 @@ class VideoDetailFragment : MainFragment {
val isMaximized = state == State.MAXIMIZED
val isFullScreenPortraitAllowed = Settings.instance.playback.fullscreenPortrait;
val bypassRotationPrevention = Settings.instance.other.bypassRotationPrevention;
+ val fullAutorotateLock = Settings.instance.playback.fullAutorotateLock
val currentRequestedOrientation = a.requestedOrientation
var currentOrientation = if (_currentOrientation == -1) currentRequestedOrientation else _currentOrientation
if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT && !Settings.instance.playback.reversePortrait)
@@ -105,27 +106,45 @@ class VideoDetailFragment : MainFragment {
val isAutoRotate = Settings.instance.playback.isAutoRotate()
val isFs = isFullscreen
- if (isFs && isMaximized) {
- if (isFullScreenPortraitAllowed) {
- if (isAutoRotate) {
- a.requestedOrientation = currentOrientation
- }
- } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
- if (isAutoRotate || currentOrientation != currentRequestedOrientation && (currentRequestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || currentRequestedOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT)) {
- a.requestedOrientation = currentOrientation
+ if (fullAutorotateLock) {
+ if (isFs && isMaximized) {
+ if (isFullScreenPortraitAllowed) {
+ if (isAutoRotate) {
+ a.requestedOrientation = currentOrientation
+ }
+ } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
+ if (isAutoRotate || currentOrientation != currentRequestedOrientation && (currentRequestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || currentRequestedOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT)) {
+ a.requestedOrientation = currentOrientation
+ }
+ } else {
+ a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
}
+ } else if (bypassRotationPrevention) {
+ a.requestedOrientation = currentOrientation
+ } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {
+ a.requestedOrientation = currentOrientation
} else {
- a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+ a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
}
- } else if (bypassRotationPrevention) {
- a.requestedOrientation = currentOrientation
- } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {
- a.requestedOrientation = currentOrientation
} else {
- a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+ if (isFs && isMaximized) {
+ if (isFullScreenPortraitAllowed) {
+ a.requestedOrientation = currentOrientation
+ } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) {
+ a.requestedOrientation = currentOrientation
+ } else {
+ a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
+ }
+ } else if (bypassRotationPrevention) {
+ a.requestedOrientation = currentOrientation
+ } else if (currentOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT || currentOrientation == ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {
+ a.requestedOrientation = currentOrientation
+ } else {
+ a.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
+ }
}
- Log.i(TAG, "updateOrientation (isFs = ${isFs}, currentOrientation = ${currentOrientation}, currentRequestedOrientation = ${currentRequestedOrientation}, isMaximized = ${isMaximized}, isAutoRotate = ${isAutoRotate}, isFullScreenPortraitAllowed = ${isFullScreenPortraitAllowed}) resulted in requested orientation ${activity?.requestedOrientation}");
+ Log.i(TAG, "updateOrientation (isFs = ${isFs}, currentOrientation = ${currentOrientation}, fullAutorotateLock = ${fullAutorotateLock}, currentRequestedOrientation = ${currentRequestedOrientation}, isMaximized = ${isMaximized}, isAutoRotate = ${isAutoRotate}, isFullScreenPortraitAllowed = ${isFullScreenPortraitAllowed}) resulted in requested orientation ${activity?.requestedOrientation}");
}
override fun onShownWithView(parameter: Any?, isBack: Boolean) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 064f0bdf..ae3e1162 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -379,6 +379,8 @@
Specify the sensitivity of rotation zones (decrease to make less sensitive)
Prefer Webm Video Codecs
If player should prefer Webm codecs (vp9/opus) over mp4 codecs (h264/AAC), may result in worse compatibility.
+ Full auto rotate lock
+ Prevent any rotation while rotation lock is engaged (even flipping between landscape and landscape reverse).
Prefer Webm Audio Codecs
If player should prefer Webm codecs (opus) over mp4 codecs (AAC), may result in worse compatibility.
Allow video under cutout