瀏覽代碼

Converts ssltcp candidate to tcp one on FF.

master
damencho 10 年之前
父節點
當前提交
d7317a94bb
共有 2 個檔案被更改,包括 13 行新增4 行删除
  1. 11
    2
      modules/xmpp/SDPUtil.js
  2. 2
    2
      package.json

+ 11
- 2
modules/xmpp/SDPUtil.js 查看文件

1
 /* jshint -W101 */
1
 /* jshint -W101 */
2
+var RTCBrowserType = require("../RTC/RTCBrowserType");
3
+
2
 var SDPUtil = {
4
 var SDPUtil = {
3
     filter_special_chars: function (text) {
5
     filter_special_chars: function (text) {
4
         return text.replace(/[\\\/\{,\}\+]/g, "");
6
         return text.replace(/[\\\/\{,\}\+]/g, "");
311
         line += ' ';
313
         line += ' ';
312
         line += cand.getAttribute('component');
314
         line += cand.getAttribute('component');
313
         line += ' ';
315
         line += ' ';
314
-        line += cand.getAttribute('protocol'); //.toUpperCase(); // chrome M23 doesn't like this
316
+
317
+        var protocol = cand.getAttribute('protocol');
318
+        // use tcp candidates for FF
319
+        if (RTCBrowserType.isFirefox() && protocol.toLowerCase() == 'ssltcp') {
320
+            protocol = 'tcp';
321
+        }
322
+
323
+        line += protocol; //.toUpperCase(); // chrome M23 doesn't like this
315
         line += ' ';
324
         line += ' ';
316
         line += cand.getAttribute('priority');
325
         line += cand.getAttribute('priority');
317
         line += ' ';
326
         line += ' ';
338
                 }
347
                 }
339
                 break;
348
                 break;
340
         }
349
         }
341
-        if (cand.getAttribute('protocol').toLowerCase() == 'tcp') {
350
+        if (protocol.toLowerCase() == 'tcp') {
342
             line += 'tcptype';
351
             line += 'tcptype';
343
             line += ' ';
352
             line += ' ';
344
             line += cand.getAttribute('tcptype');
353
             line += cand.getAttribute('tcptype');

+ 2
- 2
package.json 查看文件

28
     "pako": "*",
28
     "pako": "*",
29
     "retry": "0.6.1",
29
     "retry": "0.6.1",
30
     "sdp-interop": "0.1.11",
30
     "sdp-interop": "0.1.11",
31
-    "sdp-simulcast": "0.1.2",
32
-    "sdp-transform": "1.5.2",
31
+    "sdp-simulcast": "0.1.3",
32
+    "sdp-transform": "1.5.*",
33
     "socket.io-client": "1.3.6",
33
     "socket.io-client": "1.3.6",
34
     "strophe": "^1.2.2",
34
     "strophe": "^1.2.2",
35
     "strophejs-plugins": "^0.0.6",
35
     "strophejs-plugins": "^0.0.6",

Loading…
取消
儲存