@stream-io/video-client 0.5.8 → 0.5.10

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
+ ### [0.5.10](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.5.9...@stream-io/video-client-0.5.10) (2024-02-16)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **client:** do not set h264 as preference for iphone ([a014ab0](https://github.com/GetStream/stream-video-js/commit/a014ab0e5e2907d39fac45079d64d12997e2a63e))
11
+
12
+ ### [0.5.9](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.5.8...@stream-io/video-client-0.5.9) (2024-02-12)
13
+
14
+
15
+ ### Features
16
+
17
+ * **client:** add stopOnLeave param to device manager ([#1266](https://github.com/GetStream/stream-video-js/issues/1266)) ([2d0a865](https://github.com/GetStream/stream-video-js/commit/2d0a865e1f3d5a72df6bc528eb0ed5e2494eb734)), closes [#1236](https://github.com/GetStream/stream-video-js/issues/1236)
18
+
5
19
  ### [0.5.8](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.5.7...@stream-io/video-client-0.5.8) (2024-02-06)
6
20
 
7
21
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Official JavaScript SDK and Low-Level Client for [Stream Video](https://getstream.io/video/docs/)
1
+ # Official JavaScript SDK and Low-Level Client for [Stream Video](https://getstream.io/video/sdk/javascript/)
2
2
 
3
3
  <img src="../../.readme-assets/Github-Graphic-JS.jpg" alt="Stream Video for JavaScript Header image" style="box-shadow: 0 3px 10px rgb(0 0 0 / 0.2); border-radius: 1rem" />
4
4
 
@@ -7662,10 +7662,10 @@ class Publisher {
7662
7662
  if (!preferredCodec && trackType === TrackType.VIDEO) {
7663
7663
  if (isReactNative()) {
7664
7664
  const osName = getOSInfo()?.name.toLowerCase();
7665
- if (osName === 'ios' || osName === 'ipados') {
7665
+ if (osName === 'ipados') {
7666
7666
  // in ipads it was noticed that if vp8 codec is used
7667
7667
  // then the bytes sent is 0 in the outbound-rtp
7668
- // so we are forcing h264 codec for ipads and also in ios devices
7668
+ // so we are forcing h264 codec for ipads
7669
7669
  preferredCodec = 'H264';
7670
7670
  }
7671
7671
  else if (osName === 'android') {
@@ -8829,7 +8829,7 @@ const watchCallRejected = (call) => {
8829
8829
  const rejectedBy = callSession.rejected_by;
8830
8830
  const { members, callingState } = call.state;
8831
8831
  if (callingState !== CallingState.RINGING) {
8832
- call.logger('warn', 'Call is not in ringing mode (it is either accepted or rejected already). Ignoring call.rejected event.', event);
8832
+ call.logger('info', 'Call is not in ringing mode (it is either accepted or rejected already). Ignoring call.rejected event.', event);
8833
8833
  return;
8834
8834
  }
8835
8835
  if (call.isCreatedByMe) {
@@ -10242,6 +10242,10 @@ class InputMediaDeviceManager {
10242
10242
  this.call = call;
10243
10243
  this.state = state;
10244
10244
  this.trackType = trackType;
10245
+ /**
10246
+ * if true, stops the media stream when call is left
10247
+ */
10248
+ this.stopOnLeave = true;
10245
10249
  this.subscriptions = [];
10246
10250
  this.isTrackStoppedDueToTrackEnd = false;
10247
10251
  this.removeSubscriptions = () => {
@@ -10282,13 +10286,14 @@ class InputMediaDeviceManager {
10282
10286
  }
10283
10287
  }
10284
10288
  /**
10285
- * Stops the stream.
10289
+ * Stops or pauses the stream based on state.disableMode
10290
+ * @param {boolean} [forceStop=false] when true, stops the tracks regardless of the state.disableMode
10286
10291
  */
10287
- async disable() {
10292
+ async disable(forceStop = false) {
10288
10293
  this.state.prevStatus = this.state.status;
10289
- if (this.state.status === 'disabled')
10294
+ if (!forceStop && this.state.status === 'disabled')
10290
10295
  return;
10291
- const stopTracks = this.state.disableMode === 'stop-tracks';
10296
+ const stopTracks = forceStop || this.state.disableMode === 'stop-tracks';
10292
10297
  this.disablePromise = this.muteStream(stopTracks);
10293
10298
  try {
10294
10299
  await this.disablePromise;
@@ -11347,6 +11352,17 @@ class Call {
11347
11352
  this.microphone.removeSubscriptions();
11348
11353
  this.screenShare.removeSubscriptions();
11349
11354
  this.speaker.removeSubscriptions();
11355
+ const stopOnLeavePromises = [];
11356
+ if (this.camera.stopOnLeave) {
11357
+ stopOnLeavePromises.push(this.camera.disable(true));
11358
+ }
11359
+ if (this.microphone.stopOnLeave) {
11360
+ stopOnLeavePromises.push(this.microphone.disable(true));
11361
+ }
11362
+ if (this.screenShare.stopOnLeave) {
11363
+ stopOnLeavePromises.push(this.screenShare.disable(true));
11364
+ }
11365
+ await Promise.all(stopOnLeavePromises);
11350
11366
  };
11351
11367
  /**
11352
11368
  * Loads the information about the call.
@@ -14241,7 +14257,7 @@ class StreamClient {
14241
14257
  });
14242
14258
  };
14243
14259
  this.getUserAgent = () => {
14244
- const version = "0.5.8" ;
14260
+ const version = "0.5.10" ;
14245
14261
  return (this.userAgent ||
14246
14262
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14247
14263
  };