Fix MPV player vertical positioning in fullscreen mode

Remove incorrect safe area insets from offsetY calculation that was
causing unequal black bars (smaller top, larger bottom). Now properly
centers video with equal padding like AVPlayer backend.
This commit is contained in:
Arkadiusz Fal
2025-11-15 11:29:58 +01:00
parent bc8adc6348
commit a464b15e29

View File

@@ -422,7 +422,7 @@ final class MPVClient: ObservableObject {
#if os(iOS)
insets = OrientationTracker.shared.currentInterfaceOrientation.isPortrait ? SafeAreaModel.shared.safeArea.bottom : 0
#endif
let offsetY = max(0, model.playingFullScreen ? ((model.playerSize.height / 2.0) - ((height + insets) / 2)) : 0)
let offsetY = max(0, model.playingFullScreen ? ((model.playerSize.height / 2.0) - (height / 2)) : 0)
UIView.animate(withDuration: 0.2, animations: {
self.glView?.frame = CGRect(x: 0, y: offsetY, width: roundedWidth, height: height)
}) { completion in