在为最新的 webrtc 框架更新之后,我没有得到如何向用户显示本地流的原因方法已更改,在存储库的“iOS”文件夹中没有示例。
在旧代码中...
RTCVideoCapturer *capturer = [RTCVideoCapturer capturerWithDeviceName:cameraID];
RTCMediaConstraints *mediaConstraints = [self defaultMediaStreamConstraints];
RTCVideoSource *videoSource = [_factory videoSourceWithCapturer:capturer constraints:mediaConstraints];
localVideoTrack = [_factory videoTrackWithID:@"ARDAMSv0" source:videoSource];
RTCVideoCapturer 对象和 RTCVideoSource 对象在此处相互链接。
但是在新代码中......
RTCVideoSource *source = [_factory videoSource];
RTCCameraVideoCapturer *capturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:source];
[_delegate appClient:self didCreateLocalCapturer:capturer];
localVideoTrack = [_factory videoTrackWithSource:source
trackId:kARDVideoTrackId];
彼此之间没有任何联系。那么,委托方法做了什么,[_delegate appClient:self didCreateLocalCapturer:capturer]; 我不明白。[需要帮助!]