Skip to content

Connecting 2 peers. An example? #110

Closed Answered by LVala
ndrean asked this question in Q&A
May 22, 2024 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ndrean
Comment options

@LVala
Comment options

LVala May 23, 2024
Collaborator

Answer selected by LVala
@LVala
Comment options

LVala May 23, 2024
Collaborator

@ndrean
Comment options

@mickel8
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants