import SwiftUI
import WebRTC

/// SwiftUI 包装：WebRTC Metal 视频渲染视图（UIKit）。
/// 渲染视图实例由 ViewModel 持有，保证视频轨道 attach 后跨 SwiftUI 刷新周期不丢失。
struct RemoteVideoView: UIViewRepresentable {
    let videoView: RTCMTLVideoView

    func makeUIView(context: Context) -> RTCMTLVideoView {
        videoView.videoContentMode = .scaleAspectFit
        return videoView
    }

    func updateUIView(_ uiView: RTCMTLVideoView, context: Context) {}
}
