WebRTC AudioConferencing using RTCMultiConnection

© 2013 Muaz Khan<@muazkh> » @WebRTC Experiments » Google+ » What's New?

Private ?? #123456789
  1. Mesh networking model is implemented to open multiple interconnected peer connections
  2. Maximum peer connections limit is 256 (on chrome)

Feedback

Enter your email too; if you want "direct" reply!

Huge bandwidth and CPU-usage out of multiple peers interconnection:

To understand it better; assume that 10 users are sharing audio in a group. 20 RTP-ports (i.e. streams) will be created for each user. All streams are expected to be flowing concurrently; which causes audio lose/noise (echo) issues.

For each user:

  1. 10 RTP ports are opened to send audio upward i.e. for outgoing audio streams
  2. 10 RTP ports are opened to receive audio i.e. for incoming audio streams
// removing existing bandwidth lines
sdp = sdp.replace( /b=AS([^\r\n]+\r\n)/g , '');

// setting "outgoing" audio RTP port's bandwidth to "50kbit/s"
sdp = sdp.replace( /a=mid:audio\r\n/g , 'a=mid:audio\r\nb=AS:50\r\n');

Solution? Obviously a media server!

How to write audio-conference?

  1. session.audio=true
// https://www.webrtc-experiment.com/RTCMultiConnection-v1.4.js

var connection = new RTCMultiConnection();

connection.session = {
    audio: true
};

// on local/remote media stream
connection.onstream      = function(e) {}
connection.onstreamended = function(e) {}

// setup signaling to search for existing sessions
connection.connect();

// setup new session
document.getElementById('initiator').onclick = function() {
    connection.open();
};

Latest Updates