@stream-io/video-client 0.3.4 → 0.3.6

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.3.6](https://github.com/GetStream/stream-video-js/compare/client0.3.5...client0.3.6) (2023-08-23)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * device api small fixes ([#970](https://github.com/GetStream/stream-video-js/issues/970)) ([15b09fd](https://github.com/GetStream/stream-video-js/commit/15b09fd5e1d25046f8e2cbaa951f551631a91779))
11
+
12
+ ### [0.3.5](https://github.com/GetStream/stream-video-js/compare/client0.3.4...client0.3.5) (2023-08-22)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Change the backtage default value to true ([#969](https://github.com/GetStream/stream-video-js/issues/969)) ([5aff8b4](https://github.com/GetStream/stream-video-js/commit/5aff8b4695373de660d625a4945e300d1ff90610))
18
+
5
19
  ### [0.3.4](https://github.com/GetStream/stream-video-js/compare/client0.3.3...client0.3.4) (2023-08-21)
6
20
 
7
21
 
@@ -8020,7 +8020,7 @@ class CallState {
8020
8020
  *
8021
8021
  */
8022
8022
  constructor() {
8023
- this.backstageSubject = new BehaviorSubject(false);
8023
+ this.backstageSubject = new BehaviorSubject(true);
8024
8024
  this.blockedUserIdsSubject = new BehaviorSubject([]);
8025
8025
  this.createdAtSubject = new BehaviorSubject(new Date());
8026
8026
  this.endedAtSubject = new BehaviorSubject(undefined);
@@ -9925,10 +9925,10 @@ class InputMediaDeviceManager {
9925
9925
  */
9926
9926
  disable() {
9927
9927
  return __awaiter(this, void 0, void 0, function* () {
9928
+ this.state.prevStatus = this.state.status;
9928
9929
  if (this.state.status === 'disabled') {
9929
9930
  return;
9930
9931
  }
9931
- this.state.prevStatus = this.state.status;
9932
9932
  yield this.muteStream(this.state.disableMode === 'stop-tracks');
9933
9933
  this.state.setStatus('disabled');
9934
9934
  });
@@ -10552,8 +10552,13 @@ class Call {
10552
10552
  this.state.setCallingState(CallingState.JOINED);
10553
10553
  // React uses a different device management for now
10554
10554
  if (((_h = getSdkInfo()) === null || _h === void 0 ? void 0 : _h.type) !== SdkType.REACT) {
10555
- this.initCamera();
10556
- this.initMic();
10555
+ try {
10556
+ yield this.initCamera();
10557
+ yield this.initMic();
10558
+ }
10559
+ catch (error) {
10560
+ this.logger('warn', 'Camera and/or mic init failed during join call');
10561
+ }
10557
10562
  }
10558
10563
  // 3. once we have the "joinResponse", and possibly reconciled the local state
10559
10564
  // we schedule a fast subscription update for all remote participants
@@ -11286,61 +11291,65 @@ class Call {
11286
11291
  }
11287
11292
  initCamera() {
11288
11293
  var _a, _b, _c;
11289
- if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream) ||
11290
- !this.permissionsContext.hasPermission('send-video')) {
11291
- return;
11292
- }
11293
- // Set camera direction if it's not yet set
11294
- // This will also start publishing if camera is enabled
11295
- if (!this.camera.state.direction && !this.camera.state.selectedDevice) {
11296
- let defaultDirection = 'front';
11297
- const backendSetting = (_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.video.camera_facing;
11298
- if (backendSetting) {
11299
- defaultDirection = backendSetting === 'front' ? 'front' : 'back';
11294
+ return __awaiter(this, void 0, void 0, function* () {
11295
+ if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream) ||
11296
+ !this.permissionsContext.hasPermission('send-video')) {
11297
+ return;
11300
11298
  }
11301
- this.camera.selectDirection(defaultDirection);
11302
- }
11303
- else if (this.camera.state.status === 'enabled') {
11304
- // Publish already started media streams (this is the case if there is a lobby screen before join)
11305
- // Wait for media stream
11306
- this.camera.state.mediaStream$
11307
- .pipe(takeWhile((s) => s === undefined, true))
11308
- .subscribe((stream) => {
11309
- var _a;
11310
- if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream)) {
11311
- this.publishVideoStream(stream);
11299
+ // Set camera direction if it's not yet set
11300
+ // This will also start publishing if camera is enabled
11301
+ if (!this.camera.state.direction && !this.camera.state.selectedDevice) {
11302
+ let defaultDirection = 'front';
11303
+ const backendSetting = (_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.video.camera_facing;
11304
+ if (backendSetting) {
11305
+ defaultDirection = backendSetting === 'front' ? 'front' : 'back';
11312
11306
  }
11313
- });
11314
- }
11315
- // Apply backend config (this is the case if there is no lobby screen before join)
11316
- if (this.camera.state.status === undefined &&
11317
- ((_c = this.state.settings) === null || _c === void 0 ? void 0 : _c.video.camera_default_on)) {
11318
- void this.camera.enable();
11319
- }
11307
+ this.camera.selectDirection(defaultDirection);
11308
+ }
11309
+ else if (this.camera.state.status === 'enabled') {
11310
+ // Publish already started media streams (this is the case if there is a lobby screen before join)
11311
+ // Wait for media stream
11312
+ this.camera.state.mediaStream$
11313
+ .pipe(takeWhile((s) => s === undefined, true))
11314
+ .subscribe((stream) => {
11315
+ var _a;
11316
+ if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream)) {
11317
+ this.publishVideoStream(stream);
11318
+ }
11319
+ });
11320
+ }
11321
+ // Apply backend config (this is the case if there is no lobby screen before join)
11322
+ if (this.camera.state.status === undefined &&
11323
+ ((_c = this.state.settings) === null || _c === void 0 ? void 0 : _c.video.camera_default_on)) {
11324
+ yield this.camera.enable();
11325
+ }
11326
+ });
11320
11327
  }
11321
11328
  initMic() {
11322
11329
  var _a, _b;
11323
- if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream) ||
11324
- !this.permissionsContext.hasPermission('send-audio')) {
11325
- return;
11326
- }
11327
- // Publish already started media streams (this is the case if there is a lobby screen before join)
11328
- if (this.microphone.state.status === 'enabled') {
11329
- // Wait for media stream
11330
- this.microphone.state.mediaStream$
11331
- .pipe(takeWhile((s) => s === undefined, true))
11332
- .subscribe((stream) => {
11333
- var _a;
11334
- if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream)) {
11335
- this.publishAudioStream(stream);
11336
- }
11337
- });
11338
- }
11339
- // Apply backend config (this is the case if there is no lobby screen before join)
11340
- if (this.microphone.state.status === undefined &&
11341
- ((_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.audio.mic_default_on)) {
11342
- void this.microphone.enable();
11343
- }
11330
+ return __awaiter(this, void 0, void 0, function* () {
11331
+ if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream) ||
11332
+ !this.permissionsContext.hasPermission('send-audio')) {
11333
+ return;
11334
+ }
11335
+ // Publish already started media streams (this is the case if there is a lobby screen before join)
11336
+ if (this.microphone.state.status === 'enabled') {
11337
+ // Wait for media stream
11338
+ this.microphone.state.mediaStream$
11339
+ .pipe(takeWhile((s) => s === undefined, true))
11340
+ .subscribe((stream) => {
11341
+ var _a;
11342
+ if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream)) {
11343
+ this.publishAudioStream(stream);
11344
+ }
11345
+ });
11346
+ }
11347
+ // Apply backend config (this is the case if there is no lobby screen before join)
11348
+ if (this.microphone.state.status === undefined &&
11349
+ ((_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.audio.mic_default_on)) {
11350
+ yield this.microphone.enable();
11351
+ }
11352
+ });
11344
11353
  }
11345
11354
  }
11346
11355
 
@@ -12452,7 +12461,7 @@ class WSConnectionFallback {
12452
12461
  }
12453
12462
  }
12454
12463
 
12455
- const version = '0.3.4';
12464
+ const version = '0.3.6';
12456
12465
 
12457
12466
  const logger = getLogger(['location']);
12458
12467
  const HINT_URL = `https://hint.stream-io-video.com/`;