我正在尝试使用 GoogleWebRTC pod 在 iOS 应用程序中实现 WebRTC。我可以在 iOS 应用程序和 Web 客户端之间进行视频通话,在这种情况下,音频/视频工作得很好。但是,当我在两个 iOS 设备之间进行视频通话时,没有视频(音频有效)。我检查过是否有远程流并且有。
let localStream = connectionFactory?.mediaStream(withStreamId: "StreamID")
let audioTrack = connectionFactory?.audioTrack(withTrackId: "AudioTrackID")
let videoSource = connectionFactory?.avFoundationVideoSource(with: mediaConstraint)
let videoTrack = connectionFactory?.videoTrack(with: videoSource!, trackId: "VideoTrackID")
localStream?.addAudioTrack(audioTrack!)
localStream?.addVideoTrack(videoTrack!)
peerConnection?.add(localStream!)
Run Code Online (Sandbox Code Playgroud)