Browse Source

support both variants, js focus still sends "old" protocol

master
Philipp Hancke 11 years ago
parent
commit
a4614b7cb2

+ 2
- 2
libs/strophe/strophe.jingle.adapter.js View File

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('>description>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('>description>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

+ 2
- 0
libs/strophe/strophe.jingle.js View File

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, un-jingleish
153
             case 'source-add': // FIXME: proprietary
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;
157
+            case 'removesource': // FIXME: proprietary, un-jingleish
156
             case 'source-remove': // FIXME: proprietary
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;

+ 4
- 3
libs/strophe/strophe.jingle.sessionbase.js View File

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 ? 'source-add' : 'source-remove',
159
+            //action: isAdd ? 'source-add' : 'source-remove', -- not yet
160
+            action: isAdd ? 'addsource' : 'removesource',
160
             initiator: initiator,
161
             initiator: initiator,
161
             sid: sid
162
             sid: sid
162
         }
163
         }
169
         var channel = sdpMediaSsrcs[channelNum];
170
         var channel = sdpMediaSsrcs[channelNum];
170
         modify.c('content', {name: channel.mediaType});
171
         modify.c('content', {name: channel.mediaType});
171
 
172
 
172
-        modify.c('description', {xmlns:'urn:xmpp:jingle:apps:rtp:1', media: channel.mediaType});
173
+        // modify.c('description', {xmlns:'urn:xmpp:jingle:apps:rtp:1', media: channel.mediaType}); -- not yet
173
         // FIXME: not completly sure this operates on blocks and / or handles different ssrcs correctly
174
         // FIXME: not completly sure this operates on blocks and / or handles different ssrcs correctly
174
         // generate sources from lines
175
         // generate sources from lines
175
         Object.keys(channel.ssrcs).forEach(function(ssrcNum) {
176
         Object.keys(channel.ssrcs).forEach(function(ssrcNum) {
191
             });
192
             });
192
             modify.up(); // end of source
193
             modify.up(); // end of source
193
         });
194
         });
194
-        modify.up(); // end of description
195
+        // modify.up(); // end of description -- not yet
195
         modify.up(); // end of content
196
         modify.up(); // end of content
196
     });
197
     });
197
     if (modified) {
198
     if (modified) {

Loading…
Cancel
Save