浏览代码

bugfix for audio-only

j8
Philipp Hancke 11 年前
父节点
当前提交
2f9e8f661e
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      libs/colibri.js

+ 4
- 3
libs/colibri.js 查看文件

@@ -198,9 +198,11 @@ ColibriFocus.prototype.createdConference = function (result) {
198 198
 
199 199
     this.confid = $(result).find('>conference').attr('id');
200 200
     var remotecontents = $(result).find('>conference>content').get();
201
+    var numparticipants = 0;
201 202
     for (var i = 0; i < remotecontents.length; i++) {
202 203
         tmp = $(remotecontents[i]).find('>channel').get();
203 204
         this.mychannel.push($(tmp.shift()));
205
+        numparticipants = tmp.length;
204 206
         for (j = 0; j < tmp.length; j++) {
205 207
             if (this.channels[j] === undefined) {
206 208
                 this.channels[j] = [];
@@ -217,7 +219,7 @@ ColibriFocus.prototype.createdConference = function (result) {
217 219
     // only do what's in the offer
218 220
     bridgeSDP.media.length = this.mychannel.length;
219 221
     // get the mixed ssrc
220
-    for (var channel = 0; channel < remotecontents.length; channel++) {
222
+    for (var channel = 0; channel < bridgeSDP.media.length; channel++) {
221 223
         tmp = $(this.mychannel[channel]).find('>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
222 224
         // FIXME: check rtp-level-relay-type
223 225
         if (tmp.length) {
@@ -257,8 +259,7 @@ ColibriFocus.prototype.createdConference = function (result) {
257 259
         new RTCSessionDescription({type: 'answer', sdp: bridgeSDP.raw}),
258 260
         function () {
259 261
             console.log('setRemoteDescription success');
260
-            // remote channels == remotecontents length - 1!
261
-            for (var i = 0; i < remotecontents.length - 1; i++) {
262
+            for (var i = 0; i < numparticipants; i++) {
262 263
                 ob.initiate(ob.peers[i], true);
263 264
             }
264 265
         },

正在加载...
取消
保存