fix: 修复视频画面拉伸变形问题

移除视频预览层的aspectRatio约束,并将本地解码画面渲染模式从resizeAspect改为resizeAspectFill,确保视频内容正确填充显示区域。
This commit is contained in:
2026-08-01 04:09:14 +08:00
parent 2cac572702
commit 376a2c1217
2 changed files with 2 additions and 3 deletions

View File

@@ -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)
//

View File

@@ -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
}
}