'Webrtc : how to add streams to a connected RTCPeerConnection?
I am using pure HTTP polling for establish connections.
PC1 : opens cam, create and send his offer.
PC2 : accepts offer, create answer, send answer.
PC1 and PC2 are connected and PC2 can watch PC1 cam.
Now PC2 opens his cam :I display the local webcam and add video and audio to the connected pc (RTCPeerConnection)
localStream = await navigator.mediaDevices.getUserMedia({video: true, audio: true});
myVideo.srcObject = localStream; // display local webcam
localStream.getTracks().forEach((track) => pc.addTrack(track, localStream)); // add audio and video to the connected pc
However, PC1 cannot watch PC2 webcam. What did I miss : How to add streams to already connected RTCPeerConnection ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
