Browse Source

Fixes issues when given participant does not support all media types.

j8
paweldomas 11 years ago
parent
commit
5ac83ec088
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      libs/colibri/colibri.focus.js

+ 11
- 1
libs/colibri/colibri.focus.js View File

@@ -540,7 +540,8 @@ ColibriFocus.prototype.initiate = function (peer, isInitiator) {
540 540
             if (1) { //i > 0) { // not for audio FIXME: does not work as intended
541 541
                 // re-add all remote a=ssrcs
542 542
                 for (var jid in this.remotessrc) {
543
-                    if (jid == peer) continue;
543
+                    if (jid == peer || !this.remotessrc[jid][i])
544
+                        continue;
544 545
                     sdp.media[i] += this.remotessrc[jid][i];
545 546
                 }
546 547
                 // and local a=ssrc lines
@@ -714,6 +715,9 @@ ColibriFocus.prototype.updateChannel = function (remoteSDP, participant) {
714 715
     change.c('conference', {xmlns: 'http://jitsi.org/protocol/colibri', id: this.confid});
715 716
     for (channel = 0; channel < this.channels[participant].length; channel++)
716 717
     {
718
+        if (!remoteSDP.media[channel])
719
+            continue;
720
+
717 721
         var name = SDPUtil.parse_mid(SDPUtil.find_line(remoteSDP.media[channel], 'a=mid:'));
718 722
         change.c('content', {name: name});
719 723
         if (name !== 'data')
@@ -894,6 +898,9 @@ ColibriFocus.prototype.setRemoteDescription = function (session, elem, desctype)
894 898
     this.remotessrc[session.peerjid] = [];
895 899
     for (channel = 0; channel < this.channels[participant].length; channel++) {
896 900
         //if (channel == 0) continue; FIXME: does not work as intended
901
+        if (!remoteSDP.media[channel])
902
+            continue;
903
+
897 904
         if (SDPUtil.find_lines(remoteSDP.media[channel], 'a=ssrc:').length)
898 905
         {
899 906
             this.remotessrc[session.peerjid][channel] =
@@ -905,6 +912,9 @@ ColibriFocus.prototype.setRemoteDescription = function (session, elem, desctype)
905 912
     // ACT 4: add new a=ssrc lines to local remotedescription
906 913
     for (channel = 0; channel < this.channels[participant].length; channel++) {
907 914
         //if (channel == 0) continue; FIXME: does not work as intended
915
+        if (!remoteSDP.media[channel])
916
+            continue;
917
+
908 918
         if (SDPUtil.find_lines(remoteSDP.media[channel], 'a=ssrc:').length) {
909 919
             this.peerconnection.enqueueAddSsrc(
910 920
                 channel,

Loading…
Cancel
Save