@stream-io/video-client 1.11.9 → 1.11.11

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.11.11](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.11.10...@stream-io/video-client-1.11.11) (2024-11-29)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * revert [#1604](https://github.com/GetStream/stream-video-js/issues/1604) ([#1607](https://github.com/GetStream/stream-video-js/issues/1607)) ([567e4fb](https://github.com/GetStream/stream-video-js/commit/567e4fb309509b6b0d814826856d0a15efe16271))
11
+
12
+ ## [1.11.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.11.9...@stream-io/video-client-1.11.10) (2024-11-28)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * ringing calls not being left when ended ([#1601](https://github.com/GetStream/stream-video-js/issues/1601)) ([1c2b9d1](https://github.com/GetStream/stream-video-js/commit/1c2b9d1a54767652acc52cae9bb3d348c9df566f))
18
+
5
19
  ## [1.11.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.11.8...@stream-io/video-client-1.11.9) (2024-11-27)
6
20
 
7
21
 
@@ -3297,7 +3297,7 @@ const retryable = async (rpc, signal) => {
3297
3297
  return result;
3298
3298
  };
3299
3299
 
3300
- const version = "1.11.9";
3300
+ const version = "1.11.11";
3301
3301
  const [major, minor, patch] = version.split('.');
3302
3302
  let sdkInfo = {
3303
3303
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -6781,7 +6781,9 @@ const watchCallEnded = (call) => {
6781
6781
  const { callingState } = call.state;
6782
6782
  if (callingState !== CallingState.IDLE &&
6783
6783
  callingState !== CallingState.LEFT) {
6784
- call.leave({ reason: 'call.ended event received' }).catch((err) => {
6784
+ call
6785
+ .leave({ reason: 'call.ended event received', reject: false })
6786
+ .catch((err) => {
6785
6787
  call.logger('error', 'Failed to leave call after call.ended ', err);
6786
6788
  });
6787
6789
  }
@@ -8344,7 +8346,7 @@ const getAudioStream = async (trackConstraints) => {
8344
8346
  const constraints = {
8345
8347
  audio: {
8346
8348
  ...audioDeviceConstraints.audio,
8347
- ...normalizeContraints(trackConstraints),
8349
+ ...trackConstraints,
8348
8350
  },
8349
8351
  };
8350
8352
  try {
@@ -8355,6 +8357,13 @@ const getAudioStream = async (trackConstraints) => {
8355
8357
  return await getStream(constraints);
8356
8358
  }
8357
8359
  catch (error) {
8360
+ if (error instanceof DOMException &&
8361
+ error.name === 'OverconstrainedError' &&
8362
+ trackConstraints?.deviceId) {
8363
+ const { deviceId, ...relaxedContraints } = trackConstraints;
8364
+ getLogger(['devices'])('warn', 'Failed to get audio stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
8365
+ return getAudioStream(relaxedContraints);
8366
+ }
8358
8367
  getLogger(['devices'])('error', 'Failed to get audio stream', {
8359
8368
  error,
8360
8369
  constraints,
@@ -8374,7 +8383,7 @@ const getVideoStream = async (trackConstraints) => {
8374
8383
  const constraints = {
8375
8384
  video: {
8376
8385
  ...videoDeviceConstraints.video,
8377
- ...normalizeContraints(trackConstraints),
8386
+ ...trackConstraints,
8378
8387
  },
8379
8388
  };
8380
8389
  try {
@@ -8385,6 +8394,13 @@ const getVideoStream = async (trackConstraints) => {
8385
8394
  return await getStream(constraints);
8386
8395
  }
8387
8396
  catch (error) {
8397
+ if (error instanceof DOMException &&
8398
+ error.name === 'OverconstrainedError' &&
8399
+ trackConstraints?.deviceId) {
8400
+ const { deviceId, ...relaxedContraints } = trackConstraints;
8401
+ getLogger(['devices'])('warn', 'Failed to get video stream, will try again with relaxed contraints', { error, constraints, relaxedContraints });
8402
+ return getVideoStream(relaxedContraints);
8403
+ }
8388
8404
  getLogger(['devices'])('error', 'Failed to get video stream', {
8389
8405
  error,
8390
8406
  constraints,
@@ -8392,16 +8408,6 @@ const getVideoStream = async (trackConstraints) => {
8392
8408
  throw error;
8393
8409
  }
8394
8410
  };
8395
- function normalizeContraints(constraints) {
8396
- if (constraints?.deviceId === 'default' ||
8397
- (typeof constraints?.deviceId === 'object' &&
8398
- 'exact' in constraints.deviceId &&
8399
- constraints.deviceId.exact === 'default')) {
8400
- const { deviceId, ...contraintsWithoutDeviceId } = constraints;
8401
- return contraintsWithoutDeviceId;
8402
- }
8403
- return constraints;
8404
- }
8405
8411
  /**
8406
8412
  * Prompts the user for a permission to share a screen.
8407
8413
  * If the user grants the permission, a screen sharing stream is returned. Throws otherwise.
@@ -8628,7 +8634,6 @@ class InputMediaDeviceManager {
8628
8634
  }
8629
8635
  catch (error) {
8630
8636
  this.state.setDevice(prevDeviceId);
8631
- await this.applySettingsToStream();
8632
8637
  throw error;
8633
8638
  }
8634
8639
  }
@@ -9923,7 +9928,7 @@ class Call {
9923
9928
  /**
9924
9929
  * Leave the call and stop the media streams that were published by the call.
9925
9930
  */
9926
- this.leave = async ({ reject = false, reason = 'user is leaving the call', } = {}) => {
9931
+ this.leave = async ({ reject, reason = 'user is leaving the call', } = {}) => {
9927
9932
  await withoutConcurrency(this.joinLeaveConcurrencyTag, async () => {
9928
9933
  const callingState = this.state.callingState;
9929
9934
  if (callingState === CallingState.LEFT) {
@@ -9939,14 +9944,15 @@ class Call {
9939
9944
  };
9940
9945
  await waitUntilCallJoined();
9941
9946
  }
9942
- if (callingState === CallingState.RINGING) {
9947
+ if (callingState === CallingState.RINGING && reject !== false) {
9943
9948
  if (reject) {
9944
9949
  await this.reject(reason);
9945
9950
  }
9946
9951
  else {
9952
+ // if reject was undefined, we still have to cancel the call automatically
9953
+ // when I am the creator and everyone else left the call
9947
9954
  const hasOtherParticipants = this.state.remoteParticipants.length > 0;
9948
9955
  if (this.isCreatedByMe && !hasOtherParticipants) {
9949
- // I'm the one who started the call, so I should cancel it when there are no other participants.
9950
9956
  await this.reject('cancel');
9951
9957
  }
9952
9958
  }
@@ -12614,7 +12620,7 @@ class StreamClient {
12614
12620
  return await this.wsConnection.connect(this.defaultWSTimeout);
12615
12621
  };
12616
12622
  this.getUserAgent = () => {
12617
- const version = "1.11.9";
12623
+ const version = "1.11.11";
12618
12624
  return (this.userAgent ||
12619
12625
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12620
12626
  };