mirror of
https://github.com/yattee/yattee.git
synced 2025-11-15 22:48:43 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user