fix: 修复视频画面拉伸变形问题
移除视频预览层的aspectRatio约束,并将本地解码画面渲染模式从resizeAspect改为resizeAspectFill,确保视频内容正确填充显示区域。
This commit is contained in:
@@ -279,7 +279,6 @@ private struct ControlPanelView: View {
|
|||||||
viewModel.sendSwipe(x1: x1, y1: y1, x2: x2, y2: y2, duration: duration)
|
viewModel.sendSwipe(x1: x1, y1: y1, x2: x2, y2: y2, duration: duration)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
.aspectRatio(viewModel.videoAspect, contentMode: .fill)
|
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
|
|
||||||
// 录制中指示(左上角红点)
|
// 录制中指示(左上角红点)
|
||||||
|
|||||||
@@ -16,13 +16,13 @@ final class SampleBufferDisplayView: UIView {
|
|||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
super.init(frame: frame)
|
super.init(frame: frame)
|
||||||
sampleBufferLayer.videoGravity = .resizeAspect
|
sampleBufferLayer.videoGravity = .resizeAspectFill
|
||||||
backgroundColor = .black
|
backgroundColor = .black
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
sampleBufferLayer.videoGravity = .resizeAspect
|
sampleBufferLayer.videoGravity = .resizeAspectFill
|
||||||
backgroundColor = .black
|
backgroundColor = .black
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user