Quellcode durchsuchen

Detects msid changes in sdp.

The case where we had created recvonly streams (start muted on FF) and we are unmuting, this creates a sendrecv stream and adds msid, we need to signal msid so listeners to be notified and create appropriate audio/video element and to start receiving the stream.
master
damencho vor 7 Jahren
Ursprung
Commit
98acf1336d
1 geänderte Dateien mit 20 neuen und 0 gelöschten Zeilen
  1. 20
    0
      modules/xmpp/SDPDiffer.js

+ 20
- 0
modules/xmpp/SDPDiffer.js Datei anzeigen

@@ -84,6 +84,26 @@ SDPDiffer.prototype.getNewMedia = function() {
84 84
                     };
85 85
                 }
86 86
                 newMedia[othersMediaIdx].ssrcs[ssrc] = othersMedia.ssrcs[ssrc];
87
+            } else if (othersMedia.ssrcs[ssrc].lines
88
+                        && myMedia.ssrcs[ssrc].lines) {
89
+                // we want to detect just changes in adding/removing msid
90
+                const myContainMsid = myMedia.ssrcs[ssrc].lines.find(
91
+                    line => line.indexOf('msid') !== -1) !== undefined;
92
+                const newContainMsid = othersMedia.ssrcs[ssrc].lines.find(
93
+                    line => line.indexOf('msid') !== -1) !== undefined;
94
+
95
+                if (myContainMsid !== newContainMsid) {
96
+                    if (!newMedia[othersMediaIdx]) {
97
+                        newMedia[othersMediaIdx] = {
98
+                            mediaindex: othersMedia.mediaindex,
99
+                            mid: othersMedia.mid,
100
+                            ssrcs: {},
101
+                            ssrcGroups: []
102
+                        };
103
+                    }
104
+                    newMedia[othersMediaIdx].ssrcs[ssrc]
105
+                        = othersMedia.ssrcs[ssrc];
106
+                }
87 107
             }
88 108
         });
89 109
 

Laden…
Abbrechen
Speichern