teleportxr 1.0.11 → 1.0.13

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'
@@ -192,8 +190,9 @@ class WebRtcConnection extends EventEmitter
192
190
  await this.waitUntilIceGatheringStateComplete(this.peerConnection, this.options);
193
191
  } catch (error)
194
192
  {
195
- console.error(error.toString());
193
+ console.error("doOffer error: "+error.toString());
196
194
  this.close();
195
+ console.log("doOffer close");
197
196
  throw error;
198
197
  }
199
198
  };
@@ -207,6 +206,7 @@ class WebRtcConnection extends EventEmitter
207
206
  escapedStr=escapedStr.replaceAll('\n','\\n');
208
207
  } catch(error)
209
208
  {
209
+ console.error("applyAnswer error: "+error.toString());
210
210
  }
211
211
  var sessionDescription=new wrtc.RTCSessionDescription();
212
212
  sessionDescription.sdp=answer;
@@ -215,15 +215,19 @@ class WebRtcConnection extends EventEmitter
215
215
  };
216
216
  this.applyRemoteCandidate = async(candidate_txt,mid,mlineindex)=>
217
217
  {
218
- console.log("received remote candidate.");
219
- this.peerConnection.addIceCandidate(new wrtc.RTCIceCandidate({
218
+ console.log("received remote candidate: "+candidate_txt);
219
+ const ice=new wrtc.RTCIceCandidate({
220
220
  candidate: candidate_txt,
221
221
  sdpMLineIndex: mlineindex,
222
222
  sdpMid: mid
223
- }));
223
+ });
224
+ this.peerConnection.addIceCandidate(ice).catch((e)=>{
225
+ console.log(`Failure during addIceCandidate(): ${e.name}`);
226
+ });
224
227
  };
225
228
  this.close = () =>
226
229
  {
230
+ console.log("WebRtcConnection.close()");
227
231
  this.peerConnection.removeEventListener('iceconnectionstatechange', onIceConnectionStateChange);
228
232
  if (connectionTimer)
229
233
  {
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.11",
16
+ "version": "1.0.13",
17
17
  "repository": {
18
18
  "type": "git",
19
19
  "url": "git+https://github.com/simul/teleport-nodejs.git"