From 376a2c1217831e1bb3bee6d5337ad19eff7ba2b2 Mon Sep 17 00:00:00 2001 From: TongTongStudio Date: Sat, 1 Aug 2026 04:09:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E6=8B=89=E4=BC=B8=E5=8F=98=E5=BD=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除视频预览层的aspectRatio约束,并将本地解码画面渲染模式从resizeAspect改为resizeAspectFill,确保视频内容正确填充显示区域。 --- .../web_rtc_controller_ios/Views/ContentView.swift | 1 - .../web_rtc_controller_ios/Views/SelfCodecDisplayView.swift | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/webrtc_controller_ios/web_rtc_controller_ios/Views/ContentView.swift b/webrtc_controller_ios/web_rtc_controller_ios/Views/ContentView.swift index 7037de0..cbf6972 100644 --- a/webrtc_controller_ios/web_rtc_controller_ios/Views/ContentView.swift +++ b/webrtc_controller_ios/web_rtc_controller_ios/Views/ContentView.swift @@ -279,7 +279,6 @@ private struct ControlPanelView: View { viewModel.sendSwipe(x1: x1, y1: y1, x2: x2, y2: y2, duration: duration) }) } - .aspectRatio(viewModel.videoAspect, contentMode: .fill) .frame(maxWidth: .infinity, maxHeight: .infinity) // 录制中指示(左上角红点) diff --git a/webrtc_controller_ios/web_rtc_controller_ios/Views/SelfCodecDisplayView.swift b/webrtc_controller_ios/web_rtc_controller_ios/Views/SelfCodecDisplayView.swift index 8acfdfc..0bf7443 100644 --- a/webrtc_controller_ios/web_rtc_controller_ios/Views/SelfCodecDisplayView.swift +++ b/webrtc_controller_ios/web_rtc_controller_ios/Views/SelfCodecDisplayView.swift @@ -16,13 +16,13 @@ final class SampleBufferDisplayView: UIView { override init(frame: CGRect) { super.init(frame: frame) - sampleBufferLayer.videoGravity = .resizeAspect + sampleBufferLayer.videoGravity = .resizeAspectFill backgroundColor = .black } required init?(coder: NSCoder) { super.init(coder: coder) - sampleBufferLayer.videoGravity = .resizeAspect + sampleBufferLayer.videoGravity = .resizeAspectFill backgroundColor = .black } }