Skip to content

StreamVault is a TV-first free IPTV player for Android TV built with Kotlin, Jetpack Compose, Room, Hilt, and Media3.

Allow portrait mode on mobile devices while keeping TVs landscape-locked

disclosurez340804286b55
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index adf571d9..76289309 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -59,7 +59,7 @@
android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize|screenLayout|smallestScreenSize"
android:launchMode="singleTask"
android:supportsPictureInPicture="true"
- android:screenOrientation="landscape"
+ android:screenOrientation="unspecified"
android:windowSoftInputMode="adjustResize">
<intent-filter>
diff --git a/app/src/main/java/com/streamvault/app/MainActivity.kt b/app/src/main/java/com/streamvault/app/MainActivity.kt
index 85465d9e..7ef8b42d 100644
--- a/app/src/main/java/com/streamvault/app/MainActivity.kt
+++ b/app/src/main/java/com/streamvault/app/MainActivity.kt
@@ -132,6 +132,9 @@ class MainActivity : ComponentActivity() {
_pictureInPictureModeFlow.value = isInPictureInPictureMode
handleExternalIntent(intent)
if (isTelevisionDevice()) {
+ // Lock TVs to landscape — the manifest uses "unspecified" so phones/tablets
+ // can freely rotate, but TV UI is designed for landscape only.
+ requestedOrientation = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
lifecycleScope.launch {
watchNextManager.refreshWatchNext()
launcherRecommendationsManager.refreshRecommendations()