DEV Community

Discussion on: WebRTC - A Simple Video Chat With JavaScript (Part 1)

Collapse
 
dcsan profile image
dc

I assume this is using p2p web RTC? how easy is it to get it working for say a four-way chat even with voice only

Collapse
 
jeffersonxavier profile image
Jefferson Xavier

Hi, thanks for your comment.

It's simple, to open stream with voice only just pass the option video with false to getUserMedia() function like

{video: false, audio: true}

To open connection with multiple users the dynamic is same. Use all array received in other-users socket event calling the new RTCPeerConnection to any user and change the variables localConnection and remoteConnection to store a array with all connections initiated or received.