-
I (try to) connect 2 peers to stream their camera once in a given room, one on Chrome, the other of Firefox. Not there yet. The road seems long so I share some problems encountered. I would be glad to present a working example with your library. I basically followed Reco with a Lobby that supervises and starts a dedicated Room GenServer (per room_id), and a JS hook (once in the room) that starts a dedicated Channel per room. Perhaps only my JS is refactored a bit differently. I encountered various errors and my process always dies.
which seemed fixed by queueing the candidates and adding them once the remoteDescription is set.
When I look at HANDLING THE INVITATION, they seem to follow exactly what |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @ndrean! Could you share your code with us? I know it's similar to reco but I would like to run it locally :) |
Beta Was this translation helpful? Give feedback.
Hi, I'm not sure if I follow, but your goal is to forward media from peer X to peer Y and from peer Y to peer X (so they see and hear each other, basically)? If so, it seems that you use only a single PeerConnection in your
Rtc.Room
module, when you should create a PeerConnection per peer.PeerConnection is (simplifying a bit) a unique pair of IP addresses, so in your case, the setup would look like this: PeerConnection1 (Peer X <-> your server), PeerConnection2 (your server <-> Peer Y). Then you have to pass the media (so the RTP packets received from message
{:ex_webrtc, peer_connection_pid, {:rtp, track_id, packet}}
) from peer X to peer Y and peer Y to peer X.Take a look at the Broadc…