teleportxr 1.0.10 → 1.0.12

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.
@@ -77,9 +77,7 @@ class WebRtcConnection extends EventEmitter
77
77
  reconnect()
78
78
  {
79
79
  this.peerConnection =new DefaultRTCPeerConnection({ sdpSemantics: 'unified-plan'});
80
-
81
80
  this.beforeOffer();
82
-
83
81
  let connectionTimer = this.options.setTimeout(() =>
84
82
  {
85
83
  if (this.peerConnection.iceConnectionState !== 'connected'
@@ -127,7 +125,10 @@ class WebRtcConnection extends EventEmitter
127
125
 
128
126
  this.peerConnection.addEventListener('iceconnectionstatechange', onIceConnectionStateChange);
129
127
  this.peerConnection.addEventListener('icegatheringstatechange', onIceGatheringStateChange);
128
+ this.peerConnection.addEventListener("icecandidateerror", (event) => {
130
129
 
130
+ console.log("ICE candidate error: "+str(event.errorCode)+" "+event.errorText+" "+event.port+" "+event.url);
131
+ });
131
132
 
132
133
  const onConnectionStateChange = () =>
133
134
  {
@@ -212,12 +213,15 @@ class WebRtcConnection extends EventEmitter
212
213
  };
213
214
  this.applyRemoteCandidate = async(candidate_txt,mid,mlineindex)=>
214
215
  {
215
- console.log("received remote candidate.");
216
- this.peerConnection.addIceCandidate(new wrtc.RTCIceCandidate({
216
+ console.log("received remote candidate: "+candidate_txt);
217
+ const ice=new wrtc.RTCIceCandidate({
217
218
  candidate: candidate_txt,
218
219
  sdpMLineIndex: mlineindex,
219
220
  sdpMid: mid
220
- }));
221
+ });
222
+ this.peerConnection.addIceCandidate(ice).catch((e)=>{
223
+ console.log(`Failure during addIceCandidate(): ${e.name}`);
224
+ });
221
225
  };
222
226
  this.close = () =>
223
227
  {
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "name": "teleportxr",
15
15
  "description": "Teleport Spatial Server on node.js",
16
- "version": "1.0.10",
16
+ "version": "1.0.12",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/simul/teleport-nodejs.git"