Files
VibeCoding/webrtc_controller_ios/web_rtc_controller_ios/Views/RemoteVideoView.swift
TongTongStudio 2cac572702 fix(iOS): 修复视频显示模式为填充
将远端视频渲染视图和内容视图的视频内容模式从 `.fit` 改为 `.fill`,并调整控制面板布局,将录制与断开按钮单独成行,提升界面利用率与操作体验。
2026-08-01 04:04:19 +08:00

16 lines
507 B
Swift
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import SwiftUI
import WebRTC
/// SwiftUI WebRTC Metal UIKit
/// ViewModel attach SwiftUI
struct RemoteVideoView: UIViewRepresentable {
let videoView: RTCMTLVideoView
func makeUIView(context: Context) -> RTCMTLVideoView {
videoView.videoContentMode = .scaleAspectFill
return videoView
}
func updateUIView(_ uiView: RTCMTLVideoView, context: Context) {}
}