Fix player controls clipping in resizable iPad windows

When playing video fullscreen in a resizable window on iPad, the player
height was being forced to UIScreen.main.bounds.size.height, which is
the full screen size. In resizable windows, this caused the player
container to extend beyond the visible window bounds, clipping controls
at the bottom.

Now on iPad, the player uses natural geometry provided by its container
which respects actual window bounds, while iPhone continues using
screen-based calculation for proper fullscreen behavior.
This commit is contained in:
Arkadiusz Fal
2025-11-14 23:26:20 +01:00
parent 2ca08c8af5
commit d5f9a24efa

View File

@@ -241,6 +241,13 @@ struct VideoPlayerView: View {
}
var playerHeight: Double? {
// On iPad, don't force a specific height in fullscreen mode
// This allows the player to properly fit within resizable windows
if UIDevice.current.userInterfaceIdiom == .pad {
return nil
}
// For iPhone, use screen bounds to ensure proper fullscreen sizing
let lockedPortrait = player.lockedOrientation?.contains(.portrait) ?? false
let isPortrait = OrientationTracker.shared.currentInterfaceOrientation.isPortrait || lockedPortrait
return fullScreenPlayer ? UIScreen.main.bounds.size.height - (isPortrait ? safeAreaModel.safeArea.top + safeAreaModel.safeArea.bottom : 0) : nil