瀏覽代碼

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

master
Philipp Hancke 11 年之前
父節點
當前提交
a4614b7cb2

+ 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('>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 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('>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 258
         tmp.each(function () {
259 259
             var ssrc = $(this).attr('ssrc');
260 260
             // This should never happen, but can be useful for bug detection

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

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

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

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

Loading…
取消
儲存