@stream-io/video-client 1.6.4 → 1.6.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,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [1.6.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.4...@stream-io/video-client-1.6.5) (2024-09-19)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * race condition in `applySettingsToStream` ([#1489](https://github.com/GetStream/stream-video-js/issues/1489)) ([bf2ad90](https://github.com/GetStream/stream-video-js/commit/bf2ad90224d88592d4ea27ea8d0683efe98771f7))
11
+
5
12
  ## [1.6.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.6.3...@stream-io/video-client-1.6.4) (2024-09-13)
6
13
 
7
14
 
@@ -6820,7 +6820,7 @@ const retryable = async (rpc, signal) => {
6820
6820
  return result;
6821
6821
  };
6822
6822
 
6823
- const version = "1.6.4" ;
6823
+ const version = "1.6.5" ;
6824
6824
  const [major, minor, patch] = version.split('.');
6825
6825
  let sdkInfo = {
6826
6826
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -11769,10 +11769,12 @@ class InputMediaDeviceManager {
11769
11769
  await this.applySettingsToStream();
11770
11770
  }
11771
11771
  async applySettingsToStream() {
11772
- if (this.enabled) {
11773
- await this.muteStream();
11774
- await this.unmuteStream();
11775
- }
11772
+ await withCancellation(this.statusChangeConcurrencyTag, async () => {
11773
+ if (this.enabled) {
11774
+ await this.muteStream();
11775
+ await this.unmuteStream();
11776
+ }
11777
+ });
11776
11778
  }
11777
11779
  getTracks() {
11778
11780
  return this.state.mediaStream?.getTracks() ?? [];
@@ -11915,17 +11917,19 @@ class InputMediaDeviceManager {
11915
11917
  }
11916
11918
  if (this.state.mediaStream !== stream) {
11917
11919
  this.state.setMediaStream(stream, await rootStream);
11920
+ const handleTrackEnded = async () => {
11921
+ await this.statusChangeSettled();
11922
+ if (this.enabled) {
11923
+ this.isTrackStoppedDueToTrackEnd = true;
11924
+ setTimeout(() => {
11925
+ this.isTrackStoppedDueToTrackEnd = false;
11926
+ }, 2000);
11927
+ await this.disable();
11928
+ }
11929
+ };
11918
11930
  this.getTracks().forEach((track) => {
11919
- track.addEventListener('ended', async () => {
11920
- await this.statusChangeSettled();
11921
- if (this.enabled) {
11922
- this.isTrackStoppedDueToTrackEnd = true;
11923
- setTimeout(() => {
11924
- this.isTrackStoppedDueToTrackEnd = false;
11925
- }, 2000);
11926
- await this.disable();
11927
- }
11928
- });
11931
+ track.addEventListener('ended', handleTrackEnded);
11932
+ this.subscriptions.push(() => track.removeEventListener('ended', handleTrackEnded));
11929
11933
  });
11930
11934
  }
11931
11935
  }
@@ -16114,7 +16118,7 @@ class StreamClient {
16114
16118
  });
16115
16119
  };
16116
16120
  this.getUserAgent = () => {
16117
- const version = "1.6.4" ;
16121
+ const version = "1.6.5" ;
16118
16122
  return (this.userAgent ||
16119
16123
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
16120
16124
  };