Skip to content

unable to get remote stream in case when a “remote stream” is attached by calling “peer.addStream(remoteStream) #2

Description

@muaz-khan

Issue: 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?

WebRTC -Experiment

  1. First peer will handle first three peers
  2. 2nd peer will handle next three peers (5, 6, 7)
  3. 5th peer will handle next three peers (8,9,10)
  4. 8th peer will handle next three peers (11, 12, 13)
  5. And so on.

We will get following benefits (in case of success):

  1. Video will never freeze for 11th and upper peers
  2. 1st peer don’t need to handle all participants
  3. 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.

WebRTC -Experiment

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions