muaz-khan / WebRTC-Scalable-Broadcast

This module simply initializes socket.io and configures it in a way that single broadcast can be relayed over unlimited users without any bandwidth/CPU usage issues. Everything happens peer-to-peer!
https://rtcmulticonnection.herokuapp.com/demos/Scalable-Broadcast.html
532 stars 142 forks source link

Only three connection are connecting.How to connect more then three users? #8

Open sdrraja opened 9 years ago

muaz-khan commented 8 years ago

Please try this demo instead:

Globik commented 8 years ago

Is a webinar suit with that?

muaz-khan commented 8 years ago

It isn't an ultimate solution however it can help as following:

  1. Webinar is initiated by a media server (broadcaster is streaming to server)
  2. Root-level nodes pulls stream from media server
  3. Nested 5-6 child nodes can fetch from root-nodes (using peer-to-peer methods i.e. using this scalable-broadcast techniques)

E.g.

broadcaster started streaming to mediaServerXYZ

# these are top-level nodes that pulls directly from server
peer1 connected with mediaServerXYZ and receiving stream directly from the server.
peer2 connected with mediaServerXYZ and receiving stream directly from the server.
peer3 connected with mediaServerXYZ and receiving stream directly from the server.

# these are nested/child nodes that uses p2p techniques to get relaying stream
# these nodes never connects with media server 
#       (until special case is defined i.e. if any of the top node leaves)

# peer1 can serve 3 or 5 users
normalUser1 connected with peer1
normalUser2 connected with peer1
normalUser3 connected with peer1

# peer2 can serve 3 or 5 users
normalUser4 connected with peer2
normalUser5 connected with peer2
normalUser6 connected with peer2

# peer3 can serve 3 or 5 users

and so on

# note: normalUser* merely receives. Never relays.

i.e. 100 top-level nodes are fetching stream from the server, however they are further relaying to 300 or 500 nested/child nodes.

Globik commented 8 years ago

@muaz-khan thank you for a explanation. Today tried your code of this scalable broadcast in both, in chrom and firefox, it works great with tandem of audio plus video. But don't know how to test with many users. Anyway it is a nice solution. Althou I don't quiet understand wether should a publisher to be speaking one to many subscribers or this is like a net, graph with dependents. However by the mediaserver do you mean a licode and stuff solution or a node.js instance? Or this should be a tandem node.js plus licode mediaserver?