From 0328656a44c008f94eb4744489b49b64f7303981 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Wed, 7 Jun 2023 21:56:56 +0200 Subject: [PATCH] Fix AVPlayer layout --- Model/Player/PlayerModel.swift | 4 +++- Shared/Player/VideoPlayerSizeModifier.swift | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index 0c37bc0d..b225f772 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -1079,7 +1079,9 @@ final class PlayerModel: ObservableObject { DispatchQueue.main.async { [weak self] in guard let self else { return } - self.aspectRatio = self.backend.aspectRatio + withAnimation { + self.aspectRatio = self.backend.aspectRatio + } } #endif } diff --git a/Shared/Player/VideoPlayerSizeModifier.swift b/Shared/Player/VideoPlayerSizeModifier.swift index 398f593e..83394cb8 100644 --- a/Shared/Player/VideoPlayerSizeModifier.swift +++ b/Shared/Player/VideoPlayerSizeModifier.swift @@ -25,7 +25,7 @@ struct VideoPlayerSizeModifier: ViewModifier { func body(content: Content) -> some View { content - .frame(maxWidth: geometry.size.width) + .frame(width: geometry.size.width) .frame(maxHeight: maxHeight) #if !os(macOS)