teleportxr 1.0.23 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,9 @@ class WebRtcConnection extends EventEmitter
24
24
  this.iceServers = (options && Array.isArray(options.iceServers) && options.iceServers.length)
25
25
  ? options.iceServers
26
26
  : defaultIceServers;
27
+ this.iceTransportPolicy = (options && (options.iceTransportPolicy === 'all' || options.iceTransportPolicy === 'relay'))
28
+ ? options.iceTransportPolicy
29
+ : 'all';
27
30
  this.id = id;
28
31
  this.state = 'open';
29
32
 
@@ -87,7 +90,7 @@ class WebRtcConnection extends EventEmitter
87
90
  }
88
91
  reconnect()
89
92
  {
90
- this.peerConnection =new DefaultRTCPeerConnection({ sdpSemantics: 'unified-plan', 'iceServers': this.iceServers});
93
+ this.peerConnection =new DefaultRTCPeerConnection({ sdpSemantics: 'unified-plan', iceServers: this.iceServers, iceTransportPolicy: this.iceTransportPolicy});
91
94
  this.beforeOffer();
92
95
  this.connectionTimer = this.options.setTimeout(() =>
93
96
  {
@@ -85,6 +85,11 @@ class WebRtcConnectionManager
85
85
  if (Array.isArray(iceServers))
86
86
  this.options.iceServers=iceServers;
87
87
  }
88
+ SetIceTransportPolicy(policy)
89
+ {
90
+ if (policy === 'all' || policy === 'relay')
91
+ this.options.iceTransportPolicy=policy;
92
+ }
88
93
  }
89
94
 
90
95
  WebRtcConnectionManager.create = function create (options)
package/index.js CHANGED
@@ -27,6 +27,8 @@ function initServer(signaling_port, options) {
27
27
  webRtcConnectionManager.SetSendConfigMessage(signaling.sendConfigMessage);
28
28
  if (options && Array.isArray(options.iceServers))
29
29
  webRtcConnectionManager.SetIceServers(options.iceServers);
30
+ if (options && options.iceTransportPolicy)
31
+ webRtcConnectionManager.SetIceTransportPolicy(options.iceTransportPolicy);
30
32
  return signaling.init(serverID, webRtcConnectionManager,cm.newClient.bind(cm),cm.disconnectClient.bind(cm),signaling_port);
31
33
  }
32
34
 
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "name": "teleportxr",
17
17
  "description": "Teleport Spatial Server on node.js",
18
- "version": "1.0.23",
18
+ "version": "1.0.26",
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/simul/teleport-nodejs.git"