From 2f9e8f661ef605040b89923e8da40b3d0077d20c Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Tue, 24 Dec 2013 18:50:40 +0100 Subject: [PATCH] bugfix for audio-only --- libs/colibri.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/colibri.js b/libs/colibri.js index c15713d94..3d4f84919 100644 --- a/libs/colibri.js +++ b/libs/colibri.js @@ -198,9 +198,11 @@ ColibriFocus.prototype.createdConference = function (result) { this.confid = $(result).find('>conference').attr('id'); var remotecontents = $(result).find('>conference>content').get(); + var numparticipants = 0; for (var i = 0; i < remotecontents.length; i++) { tmp = $(remotecontents[i]).find('>channel').get(); this.mychannel.push($(tmp.shift())); + numparticipants = tmp.length; for (j = 0; j < tmp.length; j++) { if (this.channels[j] === undefined) { this.channels[j] = []; @@ -217,7 +219,7 @@ ColibriFocus.prototype.createdConference = function (result) { // only do what's in the offer bridgeSDP.media.length = this.mychannel.length; // get the mixed ssrc - for (var channel = 0; channel < remotecontents.length; channel++) { + for (var channel = 0; channel < bridgeSDP.media.length; channel++) { tmp = $(this.mychannel[channel]).find('>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // FIXME: check rtp-level-relay-type if (tmp.length) { @@ -257,8 +259,7 @@ ColibriFocus.prototype.createdConference = function (result) { new RTCSessionDescription({type: 'answer', sdp: bridgeSDP.raw}), function () { console.log('setRemoteDescription success'); - // remote channels == remotecontents length - 1! - for (var i = 0; i < remotecontents.length - 1; i++) { + for (var i = 0; i < numparticipants; i++) { ob.initiate(ob.peers[i], true); } },