Browse Source

bugfix for audio-only

j8
Philipp Hancke 11 years ago
parent
commit
2f9e8f661e
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      libs/colibri.js

+ 4
- 3
libs/colibri.js View File

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

Loading…
Cancel
Save