From d188128d27f6c6bfd5494fba7e9c428be2130cb1 Mon Sep 17 00:00:00 2001 From: Koen J Date: Fri, 30 Aug 2024 12:04:10 +0200 Subject: [PATCH] Added setting to allow video to go under cutout --- app/src/main/java/com/futo/platformplayer/Settings.kt | 4 ++++ app/src/main/java/com/futo/platformplayer/Utility.kt | 3 ++- app/src/main/res/values/strings.xml | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/futo/platformplayer/Settings.kt b/app/src/main/java/com/futo/platformplayer/Settings.kt index 92e5cdb1..10ec5ae3 100644 --- a/app/src/main/java/com/futo/platformplayer/Settings.kt +++ b/app/src/main/java/com/futo/platformplayer/Settings.kt @@ -476,6 +476,10 @@ class Settings : FragmentedStorageFileJson() { var preferWebmVideo: Boolean = false; @FormField(R.string.prefer_webm_audio, FieldForm.TOGGLE, R.string.prefer_webm_audio_description, 15) var preferWebmAudio: Boolean = false; + + @FormField(R.string.allow_under_cutout, FieldForm.TOGGLE, R.string.allow_under_cutout_description, 16) + @FormFieldWarning(R.string.changing_this_field_requires_restart) + var allowVideoToGoUnderCutout: Boolean = true; } @FormField(R.string.comments, "group", R.string.comments_description, 6) diff --git a/app/src/main/java/com/futo/platformplayer/Utility.kt b/app/src/main/java/com/futo/platformplayer/Utility.kt index 369b172f..7476c600 100644 --- a/app/src/main/java/com/futo/platformplayer/Utility.kt +++ b/app/src/main/java/com/futo/platformplayer/Utility.kt @@ -147,9 +147,10 @@ fun InputStream.copyToOutputStream(inputStreamLength: Long, outputStream: Output @Suppress("DEPRECATION") fun Activity.setNavigationBarColorAndIcons() { window.navigationBarColor = ContextCompat.getColor(this, android.R.color.black); + if (Settings.instance.playback.allowVideoToGoUnderCutout) + window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { - window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES window.insetsController?.setSystemBarsAppearance(0, WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS); } else { val decorView = window.decorView; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 90d2160d..888d7b8d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -377,6 +377,8 @@ If player should prefer Webm codecs (vp9/opus) over mp4 codecs (h264/AAC), may result in worse compatibility. Prefer Webm Audio Codecs If player should prefer Webm codecs (opus) over mp4 codecs (AAC), may result in worse compatibility. + Allow video under cutout + Allow video to go underneath the screen cutout in full-screen. Allow fullscreen portrait Switch to Audio in Background Optimize bandwidth usage by switching to audio-only stream in background if available, may cause stutter @@ -399,6 +401,7 @@ Can be disabled when you are experiencing issues Allows for rotation on non-video views.\nWARNING: Not designed for it This may cause unexpected behavior, and is mostly untested. + Changing this field will require an app restart. Player Plugins Preferred Casting Quality