@stream-io/video-client 1.12.1 → 1.12.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,23 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.12.3](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.2...@stream-io/video-client-1.12.3) (2024-12-13)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * multiple rare ringing issues in react-native ([#1611](https://github.com/GetStream/stream-video-js/issues/1611)) ([4e25264](https://github.com/GetStream/stream-video-js/commit/4e25264808eab469b7b7ab184fb19961d47bdff3))
11
+
12
+ ## [1.12.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.1...@stream-io/video-client-1.12.2) (2024-12-11)
13
+
14
+
15
+ * drop docusaurus docs ([#1613](https://github.com/GetStream/stream-video-js/issues/1613)) ([8743c8d](https://github.com/GetStream/stream-video-js/commit/8743c8d221191759266010c6cd053480da1d71a5))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * pre-built timer worker ([#1617](https://github.com/GetStream/stream-video-js/issues/1617)) ([94dacef](https://github.com/GetStream/stream-video-js/commit/94dacef1c2b1e8794a42657ddab29a3b584eb0b4)), closes [#1557](https://github.com/GetStream/stream-video-js/issues/1557)
21
+
5
22
  ## [1.12.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.12.0...@stream-io/video-client-1.12.1) (2024-12-11)
6
23
 
7
24
 
@@ -3299,7 +3299,7 @@ const retryable = async (rpc, signal) => {
3299
3299
  return result;
3300
3300
  };
3301
3301
 
3302
- const version = "1.12.1";
3302
+ const version = "1.12.3";
3303
3303
  const [major, minor, patch] = version.split('.');
3304
3304
  let sdkInfo = {
3305
3305
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -6448,14 +6448,16 @@ function lazy(factory) {
6448
6448
  };
6449
6449
  }
6450
6450
 
6451
+ // Do not modify this file manually. Instead, edit worker.ts
6452
+ // and the run ./generate-timer-worker.sh
6451
6453
  const timerWorker = {
6452
- src: `var timerIdMapping = new Map();
6453
- self.addEventListener('message', function (event) {
6454
- var request = event.data;
6454
+ src: `const timerIdMapping = new Map();
6455
+ self.addEventListener('message', (event) => {
6456
+ const request = event.data;
6455
6457
  switch (request.type) {
6456
6458
  case 'setTimeout':
6457
6459
  case 'setInterval':
6458
- timerIdMapping.set(request.id, (request.type === 'setTimeout' ? setTimeout : setInterval)(function () {
6460
+ timerIdMapping.set(request.id, (request.type === 'setTimeout' ? setTimeout : setInterval)(() => {
6459
6461
  tick(request.id);
6460
6462
  if (request.type === 'setTimeout') {
6461
6463
  timerIdMapping.delete(request.id);
@@ -6470,7 +6472,7 @@ self.addEventListener('message', function (event) {
6470
6472
  }
6471
6473
  });
6472
6474
  function tick(id) {
6473
- var message = { type: 'tick', id: id };
6475
+ const message = { type: 'tick', id };
6474
6476
  self.postMessage(message);
6475
6477
  }`,
6476
6478
  };
@@ -8319,7 +8321,7 @@ class BrowserPermission {
8319
8321
  (this.wasPrompted && !forcePrompt)) {
8320
8322
  const isGranted = this.state === 'granted';
8321
8323
  if (!isGranted && throwOnNotAllowed) {
8322
- throw new DOMException('Permission was not granted previously, and prompting again is not allowed', 'NotAllowedError');
8324
+ throw new Error('Permission was not granted previously, and prompting again is not allowed');
8323
8325
  }
8324
8326
  return isGranted;
8325
8327
  }
@@ -8331,7 +8333,10 @@ class BrowserPermission {
8331
8333
  return true;
8332
8334
  }
8333
8335
  catch (e) {
8334
- if (e instanceof DOMException && e.name === 'NotAllowedError') {
8336
+ if (e &&
8337
+ typeof e === 'object' &&
8338
+ 'name' in e &&
8339
+ (e.name === 'NotAllowedError' || e.name === 'SecurityError')) {
8335
8340
  this.logger('info', 'Browser permission was not granted', {
8336
8341
  permission: this.permission,
8337
8342
  });
@@ -8486,6 +8491,14 @@ const getStream = async (constraints) => {
8486
8491
  }
8487
8492
  return stream;
8488
8493
  };
8494
+ function isOverconstrainedError(error) {
8495
+ return (error &&
8496
+ typeof error === 'object' &&
8497
+ (('name' in error && error.name === 'OverconstrainedError') ||
8498
+ ('message' in error &&
8499
+ typeof error.message === 'string' &&
8500
+ error.message.startsWith('OverconstrainedError'))));
8501
+ }
8489
8502
  /**
8490
8503
  * Returns an audio media stream that fulfills the given constraints.
8491
8504
  * If no constraints are provided, it uses the browser's default ones.
@@ -8509,12 +8522,10 @@ const getAudioStream = async (trackConstraints) => {
8509
8522
  return await getStream(constraints);
8510
8523
  }
8511
8524
  catch (error) {
8512
- if (error instanceof DOMException &&
8513
- error.name === 'OverconstrainedError' &&
8514
- trackConstraints?.deviceId) {
8515
- const { deviceId, ...relaxedContraints } = trackConstraints;
8516
- getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
8517
- return getAudioStream(relaxedContraints);
8525
+ if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
8526
+ const { deviceId, ...relaxedConstraints } = trackConstraints;
8527
+ getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
8528
+ return getAudioStream(relaxedConstraints);
8518
8529
  }
8519
8530
  getLogger(['devices'])('error', 'Failed to get audio stream', {
8520
8531
  error,
@@ -8546,12 +8557,10 @@ const getVideoStream = async (trackConstraints) => {
8546
8557
  return await getStream(constraints);
8547
8558
  }
8548
8559
  catch (error) {
8549
- if (error instanceof DOMException &&
8550
- error.name === 'OverconstrainedError' &&
8551
- trackConstraints?.deviceId) {
8552
- const { deviceId, ...relaxedContraints } = trackConstraints;
8553
- getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
8554
- return getVideoStream(relaxedContraints);
8560
+ if (isOverconstrainedError(error) && trackConstraints?.deviceId) {
8561
+ const { deviceId, ...relaxedConstraints } = trackConstraints;
8562
+ getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed constraints', { error, constraints, relaxedConstraints });
8563
+ return getVideoStream(relaxedConstraints);
8555
8564
  }
8556
8565
  getLogger(['devices'])('error', 'Failed to get video stream', {
8557
8566
  error,
@@ -12802,7 +12811,7 @@ class StreamClient {
12802
12811
  return await this.wsConnection.connect(this.defaultWSTimeout);
12803
12812
  };
12804
12813
  this.getUserAgent = () => {
12805
- const version = "1.12.1";
12814
+ const version = "1.12.3";
12806
12815
  return (this.userAgent ||
12807
12816
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12808
12817
  };
@@ -13223,13 +13232,13 @@ class StreamVideoClient {
13223
13232
  if (typeof apiKeyOrArgs === 'string') {
13224
13233
  logLevel = opts?.logLevel || logLevel;
13225
13234
  logger = opts?.logger || logger;
13226
- if (opts?.expertimental_enableTimerWorker)
13235
+ if (opts?.enableTimerWorker)
13227
13236
  enableTimerWorker();
13228
13237
  }
13229
13238
  else {
13230
13239
  logLevel = apiKeyOrArgs.options?.logLevel || logLevel;
13231
13240
  logger = apiKeyOrArgs.options?.logger || logger;
13232
- if (apiKeyOrArgs.options?.expertimental_enableTimerWorker)
13241
+ if (apiKeyOrArgs.options?.enableTimerWorker)
13233
13242
  enableTimerWorker();
13234
13243
  }
13235
13244
  setLogger(logger, logLevel);