mafintosh / webrtc-swarm

Create a swarm of p2p connections using webrtc and a signalhub
MIT License
380 stars 60 forks source link

can this be used for video/audio webrtc ? #24

Open yarekc opened 7 years ago

yarekc commented 7 years ago

I wonder if this project is uitable as SFU server for webrtc audio/video chats ?

tvedtorama commented 6 years ago

Yes it can. Seems, however, that you need to pass a single stream to the swarm when creating it. From what I understand - this stream will then be used for all peers. This doesn't give you the best control of who sees your data, etc.

When a new peer is connected, you can pick up their stream and show it on your web page.

See also other issues on this project - and this thread on adding streams to connections after they are added: https://github.com/feross/simple-peer/issues/50

didlie commented 4 years ago

WebRTC spec requires that you initiate a peer with getUserMedia stream at the time the peer is created. If you create a peer with only a dataChannel, you cannot upgrade it. You must create another peer instance on both ends!