@stream-io/video-client 0.0.42 → 0.0.43

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.43](https://github.com/GetStream/stream-video-js/compare/client0.0.42...client0.0.43) (2023-07-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Attempt to recover Publisher PeerConnection ([#787](https://github.com/GetStream/stream-video-js/issues/787)) ([0ac2b58](https://github.com/GetStream/stream-video-js/commit/0ac2b5834fba01c01a5d7d0589ce42a5940643af))
11
+
5
12
  ### [0.0.42](https://github.com/GetStream/stream-video-js/compare/client0.0.41...client0.0.42) (2023-07-12)
6
13
 
7
14
 
@@ -6315,6 +6315,13 @@ class Publisher {
6315
6315
  yield this.negotiate({ iceRestart: true });
6316
6316
  }
6317
6317
  });
6318
+ /**
6319
+ * Restarts the ICE connection and renegotiates with the SFU.
6320
+ */
6321
+ this.restartIce = () => {
6322
+ this.logger('debug', 'Restarting ICE connection');
6323
+ this.pc.restartIce();
6324
+ };
6318
6325
  this.onNegotiationNeeded = () => __awaiter(this, void 0, void 0, function* () {
6319
6326
  yield this.negotiate();
6320
6327
  });
@@ -6455,7 +6462,12 @@ class Publisher {
6455
6462
  this.logger('error', `ICE Candidate error`, errorMessage);
6456
6463
  };
6457
6464
  this.onIceConnectionStateChange = () => {
6458
- this.logger('debug', `ICE Connection state changed`, this.pc.iceConnectionState);
6465
+ const state = this.pc.iceConnectionState;
6466
+ this.logger('debug', `ICE Connection state changed`, state);
6467
+ if (state === 'failed' || state === 'disconnected') {
6468
+ this.logger('warn', `ICE Connection state changed to ${state}. Attempting to restart ICE`);
6469
+ this.restartIce();
6470
+ }
6459
6471
  };
6460
6472
  this.onIceGatheringStateChange = () => {
6461
6473
  this.logger('debug', `ICE Gathering State`, this.pc.iceGatheringState);
@@ -6582,6 +6594,13 @@ class Subscriber {
6582
6594
  // replace the PeerConnection instance
6583
6595
  this.pc = pc;
6584
6596
  };
6597
+ /**
6598
+ * Restarts the ICE connection and renegotiates with the SFU.
6599
+ */
6600
+ this.restartIce = () => {
6601
+ logger$1('debug', 'Restarting ICE connection');
6602
+ this.pc.restartIce();
6603
+ };
6585
6604
  this.handleOnTrack = (e) => {
6586
6605
  const [primaryStream] = e.streams;
6587
6606
  // example: `e3f6aaf8-b03d-4911-be36-83f47d37a76a:TRACK_TYPE_VIDEO`
@@ -11768,7 +11787,7 @@ class StreamClient {
11768
11787
  };
11769
11788
  this.getUserAgent = () => {
11770
11789
  return (this.userAgent ||
11771
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.41"}`);
11790
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.42"}`);
11772
11791
  };
11773
11792
  this.setUserAgent = (userAgent) => {
11774
11793
  this.userAgent = userAgent;