unable to get remote stream in case when a “remote stream” is attached by calling “peer.addStream(remoteStream)
See original GitHub issueIssue: unable to get remote stream in case when a “remote stream” is attached by calling “peer.addStream ( remoteStream )”
Is it beneficial to attach remote stream?
Yeah, it allows us overcome burden from a single peer. Burden will be shared.
Also, we can support a wide range of peer’s connectivity.
How to attach remote stream?
var MediaStream = window.webkitMediaStream || window.MediaStream;
firstPeer.onaddstream = function(remoteSteam) {
remoteStream = new MediaStream(remoteSteam.audioTracks, remoteSteam.videoTracks);
otherPeer.addStream(remoteStream); /* attaching remote stream */
};
What I want to do?

- First peer will handle first three peers
- 2nd peer will handle next three peers (5, 6, 7)
- 5th peer will handle next three peers (8,9,10)
- 8th peer will handle next three peers (11, 12, 13)
- And so on.
We will get following benefits (in case of success):
- Video will never freeze for 11th and upper peers
- 1st peer don’t need to handle all participants
- You don’t need to install/buy a middle server (like Asterisk) for small projects (to support a few hundred peers’ connectivity)
A known bug in chromium: peer.onicecandidate not fires for 11th peer. You don’t need to worry about that bug!!
Pitfall: If peer number 1, 2, 5, 8 … tries to leave the room without informing other peers to play a host role.

If peer number 2 leaves the room, without informing master peer or peer number 5 to handling upcoming peers.
A demo experiment to test it:
https://googledrive.com/host/0B6GWd_dUUTT8V1Fodm9WQldkb28/
Open 4 tabs…1st table should create room………join room from other tabs…see the behavior of the 4th tab.
Issue Analytics
- State:
- Created 11 years ago
- Comments:41 (13 by maintainers)

Top Related StackOverflow Question
Any progress on this module? I’m looking for a solution for 100-200 listeners vs 1 streamer.
@muaz-khan For solving the problem you describe with peer-5 leaving, could the server instead tell peer 6 or 7 (who should be in the same link in the chain as 5) to take over instead? Similarly, could this system be made redundant/safe by having each child peer be aware of all 3 parent peers in the chain and fallback automatically if one drops?