Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Remote stream is not rendered. #45

Open
lboquan opened this issue Dec 28, 2017 · 1 comment
Open

Remote stream is not rendered. #45

lboquan opened this issue Dec 28, 2017 · 1 comment

Comments

@lboquan
Copy link

lboquan commented Dec 28, 2017

  • (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection didAddStream:(nonnull RTCMediaStream *)stream {
    dispatch_async(dispatch_get_main_queue(), ^{
    self.remoteVideoTrack = [stream.videoTracks firstObject];
    [self.remoteVideoTrack addRenderer:self.remoteView];
    });
    }

Where self.remoteView is a RTCEAGLVideoView class.

@agungpratama
Copy link

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)
            
        }
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants