瀏覽代碼

feat: Add an option to allow turn/udp for the videobridge PC. (#1212)

* feat: Add an option to allow turn/udp for the videobridge PC.
dev1
bgrozev 5 年之前
父節點
當前提交
812d0745a7
No account linked to committer's email address
共有 1 個文件被更改,包括 10 次插入4 次删除
  1. 10
    4
      modules/xmpp/strophe.jingle.js

+ 10
- 4
modules/xmpp/strophe.jingle.js 查看文件

@@ -376,10 +376,16 @@ export default class JingleConnectionPlugin extends ConnectionPlugin {
376 376
                 }
377 377
 
378 378
                 if (options.useStunTurn) {
379
-                    // we want to filter and leave only tcp/turns candidates
380
-                    // which make sense for the jvb connections
381
-                    this.jvbIceConfig.iceServers
382
-                        = iceservers.filter(s => s.urls.startsWith('turns'));
379
+                    let filter;
380
+
381
+                    if (options.useTurnUdp) {
382
+                        filter = s => s.urls.startsWith('turn');
383
+                    } else {
384
+                        // By default we filter out STUN and TURN/UDP and leave only TURN/TCP.
385
+                        filter = s => s.startsWith('turn') && s.urls.indexOf('transport=tcp');
386
+                    }
387
+
388
+                    this.jvbIceConfig.iceServers = iceservers.filter(filter);
383 389
                 }
384 390
 
385 391
                 if (options.p2p && options.p2p.useStunTurn) {

Loading…
取消
儲存