@stream-io/video-client 1.8.0 → 1.8.1

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.8.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.8.0...@stream-io/video-client-1.8.1) (2024-10-10)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * mic not fully released in some cases ([#1515](https://github.com/GetStream/stream-video-js/issues/1515)) ([b7bf90b](https://github.com/GetStream/stream-video-js/commit/b7bf90b9b1a83fb80d01a82ebee8754343963ae5))
11
+
5
12
  ## [1.8.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.7.4...@stream-io/video-client-1.8.0) (2024-10-02)
6
13
 
7
14
 
@@ -3020,7 +3020,7 @@ const retryable = async (rpc, signal) => {
3020
3020
  return result;
3021
3021
  };
3022
3022
 
3023
- const version = "1.8.0";
3023
+ const version = "1.8.1";
3024
3024
  const [major, minor, patch] = version.split('.');
3025
3025
  let sdkInfo = {
3026
3026
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -6292,9 +6292,8 @@ const watchCallRejected = (call) => {
6292
6292
  const watchCallEnded = (call) => {
6293
6293
  return function onCallEnded() {
6294
6294
  const { callingState } = call.state;
6295
- if (callingState === CallingState.RINGING ||
6296
- callingState === CallingState.JOINED ||
6297
- callingState === CallingState.JOINING) {
6295
+ if (callingState !== CallingState.IDLE &&
6296
+ callingState !== CallingState.LEFT) {
6298
6297
  call.leave({ reason: 'call.ended event received' }).catch((err) => {
6299
6298
  call.logger('error', 'Failed to leave call after call.ended ', err);
6300
6299
  });
@@ -8726,9 +8725,11 @@ class RNSpeechDetector {
8726
8725
  */
8727
8726
  async start() {
8728
8727
  try {
8728
+ this.cleanupAudioStream();
8729
8729
  const audioStream = await navigator.mediaDevices.getUserMedia({
8730
8730
  audio: true,
8731
8731
  });
8732
+ this.audioStream = audioStream;
8732
8733
  this.pc1.addEventListener('icecandidate', async (e) => {
8733
8734
  await this.pc2.addIceCandidate(e.candidate);
8734
8735
  });
@@ -8758,6 +8759,7 @@ class RNSpeechDetector {
8758
8759
  stop() {
8759
8760
  this.pc1.close();
8760
8761
  this.pc2.close();
8762
+ this.cleanupAudioStream();
8761
8763
  if (this.intervalId) {
8762
8764
  clearInterval(this.intervalId);
8763
8765
  }
@@ -8794,6 +8796,18 @@ class RNSpeechDetector {
8794
8796
  clearInterval(this.intervalId);
8795
8797
  };
8796
8798
  }
8799
+ cleanupAudioStream() {
8800
+ if (!this.audioStream) {
8801
+ return;
8802
+ }
8803
+ this.audioStream.getTracks().forEach((track) => track.stop());
8804
+ if (
8805
+ // @ts-expect-error release() is present in react-native-webrtc
8806
+ typeof this.audioStream.release === 'function') {
8807
+ // @ts-expect-error called to dispose the stream in RN
8808
+ this.audioStream.release();
8809
+ }
8810
+ }
8797
8811
  }
8798
8812
 
8799
8813
  class MicrophoneManager extends InputMediaDeviceManager {
@@ -12456,7 +12470,7 @@ class StreamClient {
12456
12470
  });
12457
12471
  };
12458
12472
  this.getUserAgent = () => {
12459
- const version = "1.8.0";
12473
+ const version = "1.8.1";
12460
12474
  return (this.userAgent ||
12461
12475
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
12462
12476
  };