mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user