@stream-io/video-client 1.15.0 → 1.15.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,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.15.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.15.1...@stream-io/video-client-1.15.2) (2025-01-20)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * improved error handling when connecting to an SFU ([#1648](https://github.com/GetStream/stream-video-js/issues/1648)) ([27332b4](https://github.com/GetStream/stream-video-js/commit/27332b484094e26a123a1dfe8bb614c35ce1022a))
11
+
12
+ ## [1.15.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.15.0...@stream-io/video-client-1.15.1) (2025-01-16)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * update mute state only for video track on mobile ([#1645](https://github.com/GetStream/stream-video-js/issues/1645)) ([c0507cb](https://github.com/GetStream/stream-video-js/commit/c0507cb02e0058b8b968237220234771c9a30e6f)), closes [#1527](https://github.com/GetStream/stream-video-js/issues/1527)
18
+
5
19
  ## [1.15.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.14.0...@stream-io/video-client-1.15.0) (2025-01-15)
6
20
 
7
21
 
@@ -6059,6 +6059,7 @@ class Subscriber extends BasePeerConnection {
6059
6059
  const createWebSocketSignalChannel = (opts) => {
6060
6060
  const { endpoint, onMessage, logTag } = opts;
6061
6061
  const logger = getLogger(['SfuClientWS', logTag]);
6062
+ logger('debug', 'Creating signaling WS channel:', endpoint);
6062
6063
  const ws = new WebSocket(endpoint);
6063
6064
  ws.binaryType = 'arraybuffer'; // do we need this?
6064
6065
  ws.addEventListener('error', (e) => {
@@ -6338,14 +6339,20 @@ class StreamSfuClient {
6338
6339
  this.dispatcher.dispatch(message, this.logTag);
6339
6340
  },
6340
6341
  });
6341
- this.signalWs.addEventListener('close', this.handleWebSocketClose);
6342
6342
  this.signalReady = makeSafePromise(Promise.race([
6343
- new Promise((resolve) => {
6343
+ new Promise((resolve, reject) => {
6344
6344
  const onOpen = () => {
6345
6345
  this.signalWs.removeEventListener('open', onOpen);
6346
6346
  resolve(this.signalWs);
6347
6347
  };
6348
6348
  this.signalWs.addEventListener('open', onOpen);
6349
+ this.signalWs.addEventListener('close', () => {
6350
+ this.handleWebSocketClose();
6351
+ // Normally, this shouldn't have any effect, because WS should never emit 'close'
6352
+ // before emitting 'open'. However, strager things have happened, and we don't
6353
+ // want to leave signalReady in pending state.
6354
+ reject(new Error('SFU WS closed unexpectedly'));
6355
+ });
6349
6356
  }),
6350
6357
  new Promise((resolve, reject) => {
6351
6358
  setTimeout(() => reject(new Error('SFU WS connection timed out')), this.joinResponseTimeout);
@@ -7346,7 +7353,7 @@ const aggregate = (stats) => {
7346
7353
  return report;
7347
7354
  };
7348
7355
 
7349
- const version = "1.15.0";
7356
+ const version = "1.15.2";
7350
7357
  const [major, minor, patch] = version.split('.');
7351
7358
  let sdkInfo = {
7352
7359
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8571,6 +8578,14 @@ const disposeOfMediaStream = (stream) => {
8571
8578
  }
8572
8579
  };
8573
8580
 
8581
+ /**
8582
+ * Checks if the current platform is a mobile device.
8583
+ *
8584
+ * See:
8585
+ * https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent
8586
+ */
8587
+ const isMobile = () => /Mobi/i.test(navigator.userAgent);
8588
+
8574
8589
  class InputMediaDeviceManager {
8575
8590
  constructor(call, state, trackType) {
8576
8591
  this.call = call;
@@ -8913,6 +8928,8 @@ class InputMediaDeviceManager {
8913
8928
  }
8914
8929
  };
8915
8930
  const createTrackMuteHandler = (muted) => () => {
8931
+ if (!isMobile() || this.trackType !== TrackType.VIDEO)
8932
+ return;
8916
8933
  this.call.notifyTrackMuteState(muted, this.trackType).catch((err) => {
8917
8934
  this.logger('warn', 'Error while notifying track mute state', err);
8918
8935
  });
@@ -9170,14 +9187,6 @@ class CameraManagerState extends InputMediaDeviceManagerState {
9170
9187
  }
9171
9188
  }
9172
9189
 
9173
- /**
9174
- * Checks if the current platform is a mobile device.
9175
- *
9176
- * See:
9177
- * https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent
9178
- */
9179
- const isMobile = () => /Mobi/i.test(navigator.userAgent);
9180
-
9181
9190
  class CameraManager extends InputMediaDeviceManager {
9182
9191
  /**
9183
9192
  * Constructs a new CameraManager.
@@ -12836,7 +12845,7 @@ class StreamClient {
12836
12845
  return await this.wsConnection.connect(this.defaultWSTimeout);
12837
12846
  };
12838
12847
  this.getUserAgent = () => {
12839
- const version = "1.15.0";
12848
+ const version = "1.15.2";
12840
12849
  return (this.userAgent ||
12841
12850
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12842
12851
  };