meeting/index.html
Setup New Meeting
|
|
|
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://www.webrtc-experiment.com/CodecsHandler.js"></script>
<script src="https://www.webrtc-experiment.com/IceServersHandler.js"></script>
<script src="https://www.webrtc-experiment.com/meeting.js"></script>
var meeting = new Meeting('meeting-unique-id');
// on getting local or remote streams
meeting.onaddstream = function(e) {
// e.type == 'local' ---- it is local media stream
// e.type == 'remote' --- it is remote media stream
document.body.appendChild(e.video);
};
// custom signaling channel
// you can use each and every signaling channel
// any websocket, socket.io, or XHR implementation
// any SIP server
// anything! etc.
meeting.openSignalingChannel = function(callback) {
return io.connect().on('message', callback);
};
// check pre-created meeting rooms
// it is useful to auto-join
// or search pre-created sessions
meeting.check('meeting room name');
document.getElementById('setup-new-meeting').onclick = function() {
meeting.setup('meeting room name');
};
// if someone leaves; just remove his video
meeting.onuserleft = function(userid) {
var video = document.getElementById(userid);
if(video) video.parentNode.removeChild(video);
};
// to leave a meeting room
meeting.leave();
Huge bandwidth and CPU-usage out of multi-peers and number of RTP-ports
To understand it better; assume that 10 users are sharing video in a group. 40 RTP-ports i.e. streams will be created for each user. All streams are expected to be flowing concurrently; which causes blur video experience and audio lose/noise (echo) issues.
For each user:
Maximum bandwidth used by each video RTP port (media-track) is about 1MB; which can be controlled using "b=AS" session description parameter values. In two-way video-only session; 2MB bandwidth is used by each peer; otherwise; a low-quality blurred video will be delivered.
// 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');
// setting "outgoing" video RTP port's bandwidth to "256kbit/s"
sdp = sdp.replace( /a=mid:video\r\n/g , 'a=mid:video\r\nb=AS:256\r\n');
Possible issues:
Solution? Obviously a media server!
Send MessageEnter your email too; if you want "direct" reply!