@stream-io/video-client 0.5.7 → 0.5.9

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/dist/index.cjs.js CHANGED
@@ -8852,7 +8852,7 @@ const watchCallRejected = (call) => {
8852
8852
  const rejectedBy = callSession.rejected_by;
8853
8853
  const { members, callingState } = call.state;
8854
8854
  if (callingState !== exports.CallingState.RINGING) {
8855
- call.logger('warn', 'Call is not in ringing mode (it is either accepted or rejected already). Ignoring call.rejected event.', event);
8855
+ call.logger('info', 'Call is not in ringing mode (it is either accepted or rejected already). Ignoring call.rejected event.', event);
8856
8856
  return;
8857
8857
  }
8858
8858
  if (call.isCreatedByMe) {
@@ -10265,6 +10265,10 @@ class InputMediaDeviceManager {
10265
10265
  this.call = call;
10266
10266
  this.state = state;
10267
10267
  this.trackType = trackType;
10268
+ /**
10269
+ * if true, stops the media stream when call is left
10270
+ */
10271
+ this.stopOnLeave = true;
10268
10272
  this.subscriptions = [];
10269
10273
  this.isTrackStoppedDueToTrackEnd = false;
10270
10274
  this.removeSubscriptions = () => {
@@ -10305,13 +10309,14 @@ class InputMediaDeviceManager {
10305
10309
  }
10306
10310
  }
10307
10311
  /**
10308
- * Stops the stream.
10312
+ * Stops or pauses the stream based on state.disableMode
10313
+ * @param {boolean} [forceStop=false] when true, stops the tracks regardless of the state.disableMode
10309
10314
  */
10310
- async disable() {
10315
+ async disable(forceStop = false) {
10311
10316
  this.state.prevStatus = this.state.status;
10312
- if (this.state.status === 'disabled')
10317
+ if (!forceStop && this.state.status === 'disabled')
10313
10318
  return;
10314
- const stopTracks = this.state.disableMode === 'stop-tracks';
10319
+ const stopTracks = forceStop || this.state.disableMode === 'stop-tracks';
10315
10320
  this.disablePromise = this.muteStream(stopTracks);
10316
10321
  try {
10317
10322
  await this.disablePromise;
@@ -11370,6 +11375,17 @@ class Call {
11370
11375
  this.microphone.removeSubscriptions();
11371
11376
  this.screenShare.removeSubscriptions();
11372
11377
  this.speaker.removeSubscriptions();
11378
+ const stopOnLeavePromises = [];
11379
+ if (this.camera.stopOnLeave) {
11380
+ stopOnLeavePromises.push(this.camera.disable(true));
11381
+ }
11382
+ if (this.microphone.stopOnLeave) {
11383
+ stopOnLeavePromises.push(this.microphone.disable(true));
11384
+ }
11385
+ if (this.screenShare.stopOnLeave) {
11386
+ stopOnLeavePromises.push(this.screenShare.disable(true));
11387
+ }
11388
+ await Promise.all(stopOnLeavePromises);
11373
11389
  };
11374
11390
  /**
11375
11391
  * Loads the information about the call.
@@ -12140,8 +12156,8 @@ class Call {
12140
12156
  /**
12141
12157
  * Starts recording the call
12142
12158
  */
12143
- this.startRecording = async () => {
12144
- return this.streamClient.post(`${this.streamClientBasePath}/start_recording`, {});
12159
+ this.startRecording = async (request) => {
12160
+ return this.streamClient.post(`${this.streamClientBasePath}/start_recording`, request ? request : {});
12145
12161
  };
12146
12162
  /**
12147
12163
  * Stops recording the call
@@ -14265,7 +14281,7 @@ class StreamClient {
14265
14281
  });
14266
14282
  };
14267
14283
  this.getUserAgent = () => {
14268
- const version = "0.5.7" ;
14284
+ const version = "0.5.9" ;
14269
14285
  return (this.userAgent ||
14270
14286
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14271
14287
  };
@@ -14788,6 +14804,21 @@ class StreamVideoServerClient extends StreamVideoClient {
14788
14804
  this.updateCallType = (name, data) => {
14789
14805
  return this.streamClient.put(`/calltypes/${name}`, data);
14790
14806
  };
14807
+ this.listExternalStorage = () => {
14808
+ return this.streamClient.get('/external_storage');
14809
+ };
14810
+ this.createExternalStorage = (request) => {
14811
+ return this.streamClient.post('/external_storage', request);
14812
+ };
14813
+ this.deleteExternalStorage = (name) => {
14814
+ return this.streamClient.delete(`/external_storage/${name}`);
14815
+ };
14816
+ this.updateExternalStorage = (name, request) => {
14817
+ return this.streamClient.put(`/external_storage/${name}`, request);
14818
+ };
14819
+ this.checkExternalStorage = (name) => {
14820
+ return this.streamClient.get(`/external_storage/${name}/check`);
14821
+ };
14791
14822
  }
14792
14823
  /**
14793
14824
  * createToken - Creates a token to authenticate this user. This function is used server side.