@stream-io/video-client 1.18.4 → 1.18.5

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,16 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.18.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.18.4...@stream-io/video-client-1.18.5) (2025-03-12)
6
+
7
+
8
+ * Upgrade to Next 15.2 ([#1717](https://github.com/GetStream/stream-video-js/issues/1717)) ([9b1aec3](https://github.com/GetStream/stream-video-js/commit/9b1aec3447dee611c0d900db44add6b6c89e2b8d))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add pending browser permission state ([#1718](https://github.com/GetStream/stream-video-js/issues/1718)) ([7f24be6](https://github.com/GetStream/stream-video-js/commit/7f24be63d33105d0688be7b5b625bc9b6aa0d3a9))
14
+
5
15
  ## [1.18.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.18.3...@stream-io/video-client-1.18.4) (2025-03-10)
6
16
 
7
17
 
@@ -3645,7 +3645,10 @@ function hasPending(tag) {
3645
3645
  return pendingPromises.has(tag);
3646
3646
  }
3647
3647
  async function settled(tag) {
3648
- await pendingPromises.get(tag)?.promise;
3648
+ let pending;
3649
+ while ((pending = pendingPromises.get(tag))) {
3650
+ await pending.promise;
3651
+ }
3649
3652
  }
3650
3653
  /**
3651
3654
  * Implements common functionality of running async functions serially, by chaining
@@ -7454,7 +7457,7 @@ const aggregate = (stats) => {
7454
7457
  return report;
7455
7458
  };
7456
7459
 
7457
- const version = "1.18.4";
7460
+ const version = "1.18.5";
7458
7461
  const [major, minor, patch] = version.split('.');
7459
7462
  let sdkInfo = {
7460
7463
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8388,6 +8391,7 @@ class BrowserPermission {
8388
8391
  }
8389
8392
  try {
8390
8393
  this.wasPrompted = true;
8394
+ this.setState('prompting');
8391
8395
  const stream = await navigator.mediaDevices.getUserMedia(this.permission.constraints);
8392
8396
  disposeOfMediaStream(stream);
8393
8397
  this.setState('granted');
@@ -8411,6 +8415,7 @@ class BrowserPermission {
8411
8415
  error: e,
8412
8416
  permission: this.permission,
8413
8417
  });
8418
+ this.setState('prompt');
8414
8419
  throw e;
8415
8420
  }
8416
8421
  });
@@ -8422,13 +8427,19 @@ class BrowserPermission {
8422
8427
  return () => this.listeners.delete(cb);
8423
8428
  }
8424
8429
  asObservable() {
8425
- return fromEventPattern((handler) => this.listen(handler), (handler, unlisten) => unlisten()).pipe(
8430
+ return this.getStateObservable().pipe(
8426
8431
  // In some browsers, the 'change' event doesn't reliably emit and hence,
8427
8432
  // permissionState stays in 'prompt' state forever.
8428
8433
  // Typically, this happens when a user grants one-time permission.
8429
8434
  // Instead of checking if a permission is granted, we check if it isn't denied
8430
8435
  map((state) => state !== 'denied'));
8431
8436
  }
8437
+ getIsPromptingObservable() {
8438
+ return this.getStateObservable().pipe(map((state) => state === 'prompting'));
8439
+ }
8440
+ getStateObservable() {
8441
+ return fromEventPattern((handler) => this.listen(handler), (handler, unlisten) => unlisten());
8442
+ }
8432
8443
  setState(state) {
8433
8444
  if (this.state !== state) {
8434
8445
  this.state = state;
@@ -9184,6 +9195,9 @@ class InputMediaDeviceManagerState {
9184
9195
  this.hasBrowserPermission$ = permission
9185
9196
  ? permission.asObservable().pipe(shareReplay(1))
9186
9197
  : of(true);
9198
+ this.isPromptingPermission$ = permission
9199
+ ? permission.getIsPromptingObservable().pipe(shareReplay(1))
9200
+ : of(false);
9187
9201
  }
9188
9202
  /**
9189
9203
  * The device status
@@ -13082,7 +13096,7 @@ class StreamClient {
13082
13096
  this.getUserAgent = () => {
13083
13097
  if (!this.cachedUserAgent) {
13084
13098
  const { clientAppIdentifier = {} } = this.options;
13085
- const { sdkName = 'js', sdkVersion = "1.18.4", ...extras } = clientAppIdentifier;
13099
+ const { sdkName = 'js', sdkVersion = "1.18.5", ...extras } = clientAppIdentifier;
13086
13100
  this.cachedUserAgent = [
13087
13101
  `stream-video-${sdkName}-v${sdkVersion}`,
13088
13102
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),