瀏覽代碼

Merge pull request #82 from jitsi/jingle-protocol-changes

protocol changes
j8
Philipp Hancke 11 年之前
父節點
當前提交
7f9bf974fb

+ 2
- 2
libs/strophe/strophe.jingle.adapter.js 查看文件

@@ -208,7 +208,7 @@ TraceablePeerConnection.prototype.addSource = function (elem) {
208 208
     $(elem).each(function (idx, content) {
209 209
         var name = $(content).attr('name');
210 210
         var lines = '';
211
-        tmp = $(content).find('>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
211
+        tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
212 212
         tmp.each(function () {
213 213
             var ssrc = $(this).attr('ssrc');
214 214
             if(mySdp.containsSSRC(ssrc)){
@@ -254,7 +254,7 @@ TraceablePeerConnection.prototype.removeSource = function (elem) {
254 254
     $(elem).each(function (idx, content) {
255 255
         var name = $(content).attr('name');
256 256
         var lines = '';
257
-        tmp = $(content).find('>source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]');
257
+        tmp = $(content).find('source[xmlns="urn:xmpp:jingle:apps:rtp:ssma:0"]'); // can handle both >source and >description>source
258 258
         tmp.each(function () {
259 259
             var ssrc = $(this).attr('ssrc');
260 260
             // This should never happen, but can be useful for bug detection

+ 4
- 2
libs/strophe/strophe.jingle.js 查看文件

@@ -150,10 +150,12 @@ Strophe.addConnectionPlugin('jingle', {
150 150
                     $(document).trigger('unmute.jingle', [sess.sid, affected]);
151 151
                 }
152 152
                 break;
153
-            case 'addsource': // FIXME: proprietary
153
+            case 'addsource': // FIXME: proprietary, un-jingleish
154
+            case 'source-add': // FIXME: proprietary
154 155
                 sess.addSource($(iq).find('>jingle>content'), fromJid);
155 156
                 break;
156
-            case 'removesource': // FIXME: proprietary
157
+            case 'removesource': // FIXME: proprietary, un-jingleish
158
+            case 'source-remove': // FIXME: proprietary
157 159
                 sess.removeSource($(iq).find('>jingle>content'), fromJid);
158 160
                 break;
159 161
             default:

+ 5
- 2
libs/strophe/strophe.jingle.sessionbase.js 查看文件

@@ -156,7 +156,7 @@ SessionBase.prototype.sendSSRCUpdateIq = function(sdpMediaSsrcs, sid, initiator,
156 156
     var modify = $iq({to: toJid, type: 'set'})
157 157
         .c('jingle', {
158 158
             xmlns: 'urn:xmpp:jingle:1',
159
-            action: isAdd ? 'addsource' : 'removesource',
159
+            action: isAdd ? 'source-add' : 'source-remove',
160 160
             initiator: initiator,
161 161
             sid: sid
162 162
         }
@@ -168,6 +168,8 @@ SessionBase.prototype.sendSSRCUpdateIq = function(sdpMediaSsrcs, sid, initiator,
168 168
         modified = true;
169 169
         var channel = sdpMediaSsrcs[channelNum];
170 170
         modify.c('content', {name: channel.mediaType});
171
+
172
+        modify.c('description', {xmlns:'urn:xmpp:jingle:apps:rtp:1', media: channel.mediaType});
171 173
         // FIXME: not completly sure this operates on blocks and / or handles different ssrcs correctly
172 174
         // generate sources from lines
173 175
         Object.keys(channel.ssrcs).forEach(function(ssrcNum) {
@@ -189,6 +191,7 @@ SessionBase.prototype.sendSSRCUpdateIq = function(sdpMediaSsrcs, sid, initiator,
189 191
             });
190 192
             modify.up(); // end of source
191 193
         });
194
+        modify.up(); // end of description
192 195
         modify.up(); // end of content
193 196
     });
194 197
     if (modified) {
@@ -220,4 +223,4 @@ SessionBase.prototype.toggleVideoMute = function (callback) {
220 223
 
221 224
     this.peerconnection.hardMuteVideo(!ismuted);
222 225
     this.modifySources(callback(!ismuted));
223
-};
226
+};

Loading…
取消
儲存