瀏覽代碼

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
     $(elem).each(function (idx, content) {
208
     $(elem).each(function (idx, content) {
209
         var name = $(content).attr('name');
209
         var name = $(content).attr('name');
210
         var lines = '';
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
         tmp.each(function () {
212
         tmp.each(function () {
213
             var ssrc = $(this).attr('ssrc');
213
             var ssrc = $(this).attr('ssrc');
214
             if(mySdp.containsSSRC(ssrc)){
214
             if(mySdp.containsSSRC(ssrc)){
254
     $(elem).each(function (idx, content) {
254
     $(elem).each(function (idx, content) {
255
         var name = $(content).attr('name');
255
         var name = $(content).attr('name');
256
         var lines = '';
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
         tmp.each(function () {
258
         tmp.each(function () {
259
             var ssrc = $(this).attr('ssrc');
259
             var ssrc = $(this).attr('ssrc');
260
             // This should never happen, but can be useful for bug detection
260
             // This should never happen, but can be useful for bug detection

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

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

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

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

Loading…
取消
儲存