I want to create a conference room using pusher and pure javascript, I managed to create a peer-to-peer connection but a many-to-many connection is proving that is a hard nut to crack. What I am trying to do is creating a connection of a specific user to a room and so that any participant that subscribes the channel their stream are share within and also can access all streams present in the channel.
participant= new RTCPeerConnection();
participant.creatOffer().then(function(desc){
//I add a stream fetch from users camera
participant.addStream(stream);
participant.setLocalDescription(new RTCSessionDescription(desc));
//using pusher I send an event that has the desc, room and from
channel.trigger('client-sdp'{
sdp:desc,
roomEvent: rooms,
from:id
})
});
I can share the whole code if required all I need to know is how to handle many-to-many connect in webRTC RTCPeerConnection();