@stream-io/video-client 1.18.0 → 1.18.2

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,22 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.18.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.18.1...@stream-io/video-client-1.18.2) (2025-03-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * do not accept again on reconnections ([#1705](https://github.com/GetStream/stream-video-js/issues/1705)) ([bedd2d8](https://github.com/GetStream/stream-video-js/commit/bedd2d8aafd7ff8260f63b500e25807518ccd365))
11
+ * do not stop original track in RN ([#1708](https://github.com/GetStream/stream-video-js/issues/1708)) ([ab0ada2](https://github.com/GetStream/stream-video-js/commit/ab0ada283c753d4cdfd59b6eaf75af26cf54fd7e))
12
+ * prevent extra unnecessary reconnect after offline to online ([#1706](https://github.com/GetStream/stream-video-js/issues/1706)) ([bc3920a](https://github.com/GetStream/stream-video-js/commit/bc3920a81f398fd9e166ee4517b32d58f50d56fe))
13
+
14
+ ## [1.18.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.18.0...@stream-io/video-client-1.18.1) (2025-02-28)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * prevent reconnecting state when offline ([#1703](https://github.com/GetStream/stream-video-js/issues/1703)) ([aeac90d](https://github.com/GetStream/stream-video-js/commit/aeac90d8b7b14820e3e0e30282e51fc7824f8bf8))
20
+
5
21
  ## [1.18.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.17.1...@stream-io/video-client-1.18.0) (2025-02-26)
6
22
 
7
23
 
@@ -5710,7 +5710,9 @@ class Publisher extends BasePeerConnection {
5710
5710
  else {
5711
5711
  const previousTrack = transceiver.sender.track;
5712
5712
  await transceiver.sender.replaceTrack(trackToPublish);
5713
- this.stopTrack(previousTrack);
5713
+ if (!isReactNative()) {
5714
+ this.stopTrack(previousTrack);
5715
+ }
5714
5716
  }
5715
5717
  }
5716
5718
  };
@@ -5811,6 +5813,11 @@ class Publisher extends BasePeerConnection {
5811
5813
  }
5812
5814
  for (const track of this.clonedTracks) {
5813
5815
  this.stopTrack(track);
5816
+ // @ts-expect-error release() is present in react-native-webrtc
5817
+ if (track && typeof track.release === 'function') {
5818
+ // @ts-expect-error
5819
+ track.release();
5820
+ }
5814
5821
  }
5815
5822
  };
5816
5823
  this.changePublishQuality = async (videoSender) => {
@@ -7463,7 +7470,7 @@ const aggregate = (stats) => {
7463
7470
  return report;
7464
7471
  };
7465
7472
 
7466
- const version = "1.18.0";
7473
+ const version = "1.18.2";
7467
7474
  const [major, minor, patch] = version.split('.');
7468
7475
  let sdkInfo = {
7469
7476
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -10624,8 +10631,12 @@ class Call {
10624
10631
  statsOptions = joinResponse.stats_options;
10625
10632
  }
10626
10633
  catch (error) {
10627
- // restore the previous call state if the join-flow fails
10628
- this.state.setCallingState(callingState);
10634
+ // prevent triggering reconnect flow if the state is OFFLINE
10635
+ const avoidRestoreState = this.state.callingState === CallingState.OFFLINE;
10636
+ if (!avoidRestoreState) {
10637
+ // restore the previous call state if the join-flow fails
10638
+ this.state.setCallingState(callingState);
10639
+ }
10629
10640
  throw error;
10630
10641
  }
10631
10642
  }
@@ -10908,7 +10919,8 @@ class Call {
10908
10919
  if (data?.ring) {
10909
10920
  this.ringingSubject.next(true);
10910
10921
  }
10911
- if (this.ringing && !this.isCreatedByMe) {
10922
+ const isReconnecting = this.reconnectStrategy !== WebsocketReconnectStrategy.UNSPECIFIED;
10923
+ if (!isReconnecting && this.ringing && !this.isCreatedByMe) {
10912
10924
  // signals other users that I have accepted the incoming call.
10913
10925
  await this.accept();
10914
10926
  }
@@ -10989,6 +11001,12 @@ class Call {
10989
11001
  break; // do-while loop, reconnection worked, exit the loop
10990
11002
  }
10991
11003
  catch (error) {
11004
+ if (this.state.callingState === CallingState.OFFLINE) {
11005
+ this.logger('trace', `[Reconnect] Can't reconnect while offline, stopping reconnection attempts`);
11006
+ break;
11007
+ // we don't need to handle the error if the call is offline
11008
+ // network change event will trigger the reconnection
11009
+ }
10992
11010
  if (error instanceof ErrorFromResponse && error.unrecoverable) {
10993
11011
  this.logger('warn', `[Reconnect] Can't reconnect due to coordinator unrecoverable error`, error);
10994
11012
  this.state.setCallingState(CallingState.RECONNECTING_FAILED);
@@ -13088,7 +13106,7 @@ class StreamClient {
13088
13106
  this.getUserAgent = () => {
13089
13107
  if (!this.cachedUserAgent) {
13090
13108
  const { clientAppIdentifier = {} } = this.options;
13091
- const { sdkName = 'js', sdkVersion = "1.18.0", ...extras } = clientAppIdentifier;
13109
+ const { sdkName = 'js', sdkVersion = "1.18.2", ...extras } = clientAppIdentifier;
13092
13110
  this.cachedUserAgent = [
13093
13111
  `stream-video-${sdkName}-v${sdkVersion}`,
13094
13112
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),