Open lboquan opened 6 years ago
same here, is there any relevant code snippet / example to how actually render the remote Stream received ? I'm using the build for a swift project
func peerConnection(_ peerConnection: RTCPeerConnection, didAdd stream: RTCMediaStream) {
print("peerConnection delegate event : RTCPeerConnection, didAdd stream")
if stream.videoTracks.count > 0{
if let lastTrack = stream.videoTracks.last{
let renderer = RTCEAGLVideoView(frame: CGRect(x: 0.0, y: 0.0, width: 100.0, height: 100.0))
renderer.backgroundColor = UIColor.orange
renderer.delegate = self
lastTrack.add(renderer)
self.remoteVideoView.addSubview(renderer)
}
}
}
Where self.remoteView is a RTCEAGLVideoView class.