Stretch the mini player's video preview to fill its frame

Wide videos showed letterbox bars in the tiny iOS mini player preview right
after the dismiss morph, which lands the video filling the preview. The
container that takes the shared player view now sets mpv's keepaspect, so
the mini player fills its frame and every other surface keeps the aspect
ratio.
This commit is contained in:
Arkadiusz Fal
2026-10-09 23:59:58 +02:00
parent 7b1a24a5b0
commit 09a384763a
3 changed files with 29 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ final class MPVBackend: PlayerBackend {
// MARK: - Private Properties
private var mpvClient: MPVClient?
#if os(iOS)
private var videoFillsFrame = false
#endif
#if os(macOS)
private var renderView: MPVOGLView?
#elseif targetEnvironment(simulator) && (os(iOS) || os(tvOS))
@@ -173,6 +176,14 @@ final class MPVBackend: PlayerBackend {
_playerView?.pauseRendering()
}
/// Stretch the video over the whole view (ignoring its aspect ratio)
/// instead of letterboxing it.
func setVideoFillsFrame(_ fills: Bool) {
guard fills != videoFillsFrame else { return }
videoFillsFrame = fills
mpvClient?.setProperty("keepaspect", !fills)
}
/// Resume video rendering
func resumeRendering() {
MPVLogging.log("MPVBackend.resumeRendering called")