teleportxr 1.0.95 → 1.0.96

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.
@@ -113,6 +113,16 @@ class WebRtcConnection extends EventEmitter
113
113
  }
114
114
  reconnect()
115
115
  {
116
+ // A browser peer that has already accepted an SDP with N m-sections will
117
+ // reject any later offer with fewer (RTCPeerConnection throws "New remote
118
+ // description has fewer m-sections than the previous remote description"),
119
+ // tearing down the whole connection. Recreating the PeerConnection below
120
+ // starts with zero transceivers, so remember which per-node audio sources
121
+ // were live beforehand and re-add matching ones on the new PeerConnection
122
+ // (below) before the next offer goes out, keeping the m-section count from
123
+ // shrinking relative to what the browser already negotiated.
124
+ const previousAudioSourceUids = this.getNodeAudioSourceUids();
125
+
116
126
  // Close and clean up the previous PeerConnection before creating a new one.
117
127
  // Failing to do so leaves the old ICE agent (and its UDP socket) alive, which
118
128
  // causes it to keep sending/receiving STUN messages with stale credentials and
@@ -136,6 +146,8 @@ class WebRtcConnection extends EventEmitter
136
146
  // the previous PeerConnection's lifetime suppresses UpdateStreaming kick.
137
147
  this._dataChannelsOpenFired = false;
138
148
  this.beforeOffer();
149
+ for (const uid of previousAudioSourceUids)
150
+ this.addNodeAudioSource(uid);
139
151
  this.connectionTimer = this.options.setTimeout(() =>
140
152
  {
141
153
  if (this.peerConnection.iceConnectionState !== 'connected'
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "name": "teleportxr",
18
18
  "description": "Teleport Spatial Server on node.js",
19
- "version": "1.0.95",
19
+ "version": "1.0.96",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/simul/teleport-nodejs.git"