@stream-io/video-client 1.19.1 → 1.19.3

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,19 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.19.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.19.2...@stream-io/video-client-1.19.3) (2025-04-15)
6
+
7
+ ### Bug Fixes
8
+
9
+ - fast reconnect shouldn't be followed up with full rejoining on network switch ([#1760](https://github.com/GetStream/stream-video-js/issues/1760)) ([71363bd](https://github.com/GetStream/stream-video-js/commit/71363bdf0fb6cd6273ff6c2a0faf9ea1eb53f121))
10
+ - watched calls should auto-subscribe for state updates ([#1762](https://github.com/GetStream/stream-video-js/issues/1762)) ([abcb45b](https://github.com/GetStream/stream-video-js/commit/abcb45b7fed4ca10e4ac6ea8ee18630ca5a9cb46)), closes [#1433](https://github.com/GetStream/stream-video-js/issues/1433)
11
+
12
+ ## [1.19.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.19.1...@stream-io/video-client-1.19.2) (2025-04-11)
13
+
14
+ ### Bug Fixes
15
+
16
+ - enhance tracing data ([#1758](https://github.com/GetStream/stream-video-js/issues/1758)) ([a6f2e3a](https://github.com/GetStream/stream-video-js/commit/a6f2e3a5256519e4884ec07e2dd2d4417f2482fe))
17
+
5
18
  ## [1.19.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.19.0...@stream-io/video-client-1.19.1) (2025-04-09)
6
19
 
7
20
  ### Bug Fixes
@@ -5643,7 +5643,7 @@ const aggregate = (stats) => {
5643
5643
  return report;
5644
5644
  };
5645
5645
 
5646
- const version = "1.19.1";
5646
+ const version = "1.19.3";
5647
5647
  const [major, minor, patch] = version.split('.');
5648
5648
  let sdkInfo = {
5649
5649
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -6041,7 +6041,7 @@ class BasePeerConnection {
6041
6041
  /**
6042
6042
  * Constructs a new `BasePeerConnection` instance.
6043
6043
  */
6044
- constructor(peerType, { sfuClient, connectionConfig, state, dispatcher, onUnrecoverableError, logTag, enableTracing, }) {
6044
+ constructor(peerType, { sfuClient, connectionConfig, state, dispatcher, onUnrecoverableError, logTag, clientDetails, enableTracing, }) {
6045
6045
  this.isIceRestarting = false;
6046
6046
  this.isDisposed = false;
6047
6047
  this.subscriptions = [];
@@ -6185,7 +6185,9 @@ class BasePeerConnection {
6185
6185
  ]);
6186
6186
  this.pc = new RTCPeerConnection(connectionConfig);
6187
6187
  if (enableTracing) {
6188
- this.tracer = new Tracer(logTag);
6188
+ const tag = `${logTag}-${peerType === PeerType.SUBSCRIBER ? 'sub' : 'pub'}`;
6189
+ this.tracer = new Tracer(tag);
6190
+ this.tracer.trace('clientDetails', clientDetails);
6189
6191
  this.tracer.trace('create', connectionConfig);
6190
6192
  traceRTCPeerConnection(this.pc, this.tracer.trace);
6191
6193
  }
@@ -7264,6 +7266,10 @@ class StreamSfuClient {
7264
7266
  * This is set to `true` when the user initiates the leave process.
7265
7267
  */
7266
7268
  this.isLeaving = false;
7269
+ /**
7270
+ * Flag to indicate if the client is in the process of closing the connection.
7271
+ */
7272
+ this.isClosing = false;
7267
7273
  this.pingIntervalInMs = 10 * 1000;
7268
7274
  this.unhealthyTimeoutInMs = this.pingIntervalInMs + 5 * 1000;
7269
7275
  /**
@@ -7315,6 +7321,7 @@ class StreamSfuClient {
7315
7321
  this.onSignalClose?.(`${e.code} ${e.reason}`);
7316
7322
  };
7317
7323
  this.close = (code = StreamSfuClient.NORMAL_CLOSURE, reason) => {
7324
+ this.isClosing = true;
7318
7325
  if (this.signalWs.readyState === WebSocket.OPEN) {
7319
7326
  this.logger('debug', `Closing SFU WS connection: ${code} - ${reason}`);
7320
7327
  this.signalWs.close(code, `js-client: ${reason}`);
@@ -8391,6 +8398,7 @@ class DynascaleManager {
8391
8398
  const { selectedDevice } = this.speaker.state;
8392
8399
  if (selectedDevice && 'setSinkId' in audioElement) {
8393
8400
  audioElement.setSinkId(selectedDevice);
8401
+ tracer.trace('navigator.mediaDevices.setSinkId', selectedDevice);
8394
8402
  }
8395
8403
  }
8396
8404
  });
@@ -8400,6 +8408,7 @@ class DynascaleManager {
8400
8408
  : this.speaker.state.selectedDevice$.subscribe((deviceId) => {
8401
8409
  if (deviceId) {
8402
8410
  audioElement.setSinkId(deviceId);
8411
+ tracer.trace('navigator.mediaDevices.setSinkId', deviceId);
8403
8412
  }
8404
8413
  });
8405
8414
  const volumeSubscription = combineLatest([
@@ -10503,6 +10512,11 @@ class Call {
10503
10512
  */
10504
10513
  this.leaveCallHooks = new Set();
10505
10514
  this.streamClientEventHandlers = new Map();
10515
+ /**
10516
+ * Sets up the call instance.
10517
+ *
10518
+ * @internal an internal method and should not be used outside the SDK.
10519
+ */
10506
10520
  this.setup = async () => {
10507
10521
  await withoutConcurrency(this.joinLeaveConcurrencyTag, async () => {
10508
10522
  if (this.initialized)
@@ -11169,6 +11183,7 @@ class Call {
11169
11183
  state: this.state,
11170
11184
  connectionConfig,
11171
11185
  logTag: String(this.sfuClientTag),
11186
+ clientDetails,
11172
11187
  enableTracing,
11173
11188
  onUnrecoverableError: (reason) => {
11174
11189
  this.reconnect(WebsocketReconnectStrategy.REJOIN, reason).catch((err) => {
@@ -11190,6 +11205,7 @@ class Call {
11190
11205
  connectionConfig,
11191
11206
  publishOptions,
11192
11207
  logTag: String(this.sfuClientTag),
11208
+ clientDetails,
11193
11209
  enableTracing,
11194
11210
  onUnrecoverableError: (reason) => {
11195
11211
  this.reconnect(WebsocketReconnectStrategy.REJOIN, reason).catch((err) => {
@@ -11271,7 +11287,7 @@ class Call {
11271
11287
  callingState === CallingState.LEFT)
11272
11288
  return;
11273
11289
  // normal close, no need to reconnect
11274
- if (sfuClient.isLeaving)
11290
+ if (sfuClient.isLeaving || sfuClient.isClosing)
11275
11291
  return;
11276
11292
  this.reconnect(WebsocketReconnectStrategy.REJOIN, reason).catch((err) => {
11277
11293
  this.logger('warn', '[Reconnect] Error reconnecting', err);
@@ -11482,9 +11498,10 @@ class Call {
11482
11498
  this.sfuStatsReporter?.start();
11483
11499
  }
11484
11500
  });
11485
- this.leaveCallHooks.add(unregisterGoAway);
11486
- this.leaveCallHooks.add(unregisterOnError);
11487
- this.leaveCallHooks.add(unregisterNetworkChanged);
11501
+ this.leaveCallHooks
11502
+ .add(unregisterGoAway)
11503
+ .add(unregisterOnError)
11504
+ .add(unregisterNetworkChanged);
11488
11505
  };
11489
11506
  /**
11490
11507
  * Restores the published tracks after a reconnection.
@@ -13426,7 +13443,7 @@ class StreamClient {
13426
13443
  this.getUserAgent = () => {
13427
13444
  if (!this.cachedUserAgent) {
13428
13445
  const { clientAppIdentifier = {} } = this.options;
13429
- const { sdkName = 'js', sdkVersion = "1.19.1", ...extras } = clientAppIdentifier;
13446
+ const { sdkName = 'js', sdkVersion = "1.19.3", ...extras } = clientAppIdentifier;
13430
13447
  this.cachedUserAgent = [
13431
13448
  `stream-video-${sdkName}-v${sdkVersion}`,
13432
13449
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
@@ -13813,6 +13830,7 @@ class StreamVideoClient {
13813
13830
  call.state.updateFromCallResponse(c.call);
13814
13831
  await call.applyDeviceConfig(c.call.settings, false);
13815
13832
  if (data.watch) {
13833
+ await call.setup();
13816
13834
  this.writeableStateStore.registerCall(call);
13817
13835
  }
13818
13836
  calls.push(call);