Skip to content

Commit f6920fb

Browse files
authored
feat: Force landscape orientation and pillarbox portrait videos on TV and emulator devices. (#2560)
1 parent f28924f commit f6920fb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,6 +2707,11 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
27072707
}
27082708

27092709
override fun playerDimensionsLoaded(width: Int, height: Int) {
2710+
// On TV, don't rotate for portrait videos; display with pillarbox (black bars on sides)
2711+
if (isLayout(TV or EMULATOR)) {
2712+
isVerticalOrientation = false
2713+
return
2714+
}
27102715
isVerticalOrientation = height > width
27112716
updateOrientation()
27122717
}
@@ -2730,6 +2735,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
27302735
}
27312736

27322737
private fun dynamicOrientation(): Int {
2738+
// TV should always remain in landscape mode
2739+
if (isLayout(TV or EMULATOR)) {
2740+
return ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
2741+
}
27332742
return if (autoPlayerRotateEnabled) {
27342743
if (isVerticalOrientation) {
27352744
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT

0 commit comments

Comments
 (0)