@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 +14 -0
- package/dist/index.browser.es.js +64 -55
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +64 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +64 -55
- package/dist/index.es.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Call.ts +10 -6
- package/src/__tests__/StreamVideoClient.test.ts +4 -2
- package/src/devices/InputMediaDeviceManager.ts +1 -1
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +17 -0
- package/src/store/CallState.ts +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8043,7 +8043,7 @@ class CallState {
|
|
|
8043
8043
|
*
|
|
8044
8044
|
*/
|
|
8045
8045
|
constructor() {
|
|
8046
|
-
this.backstageSubject = new rxjs.BehaviorSubject(
|
|
8046
|
+
this.backstageSubject = new rxjs.BehaviorSubject(true);
|
|
8047
8047
|
this.blockedUserIdsSubject = new rxjs.BehaviorSubject([]);
|
|
8048
8048
|
this.createdAtSubject = new rxjs.BehaviorSubject(new Date());
|
|
8049
8049
|
this.endedAtSubject = new rxjs.BehaviorSubject(undefined);
|
|
@@ -9948,10 +9948,10 @@ class InputMediaDeviceManager {
|
|
|
9948
9948
|
*/
|
|
9949
9949
|
disable() {
|
|
9950
9950
|
return __awaiter(this, void 0, void 0, function* () {
|
|
9951
|
+
this.state.prevStatus = this.state.status;
|
|
9951
9952
|
if (this.state.status === 'disabled') {
|
|
9952
9953
|
return;
|
|
9953
9954
|
}
|
|
9954
|
-
this.state.prevStatus = this.state.status;
|
|
9955
9955
|
yield this.muteStream(this.state.disableMode === 'stop-tracks');
|
|
9956
9956
|
this.state.setStatus('disabled');
|
|
9957
9957
|
});
|
|
@@ -10575,8 +10575,13 @@ class Call {
|
|
|
10575
10575
|
this.state.setCallingState(exports.CallingState.JOINED);
|
|
10576
10576
|
// React uses a different device management for now
|
|
10577
10577
|
if (((_h = getSdkInfo()) === null || _h === void 0 ? void 0 : _h.type) !== SdkType.REACT) {
|
|
10578
|
-
|
|
10579
|
-
|
|
10578
|
+
try {
|
|
10579
|
+
yield this.initCamera();
|
|
10580
|
+
yield this.initMic();
|
|
10581
|
+
}
|
|
10582
|
+
catch (error) {
|
|
10583
|
+
this.logger('warn', 'Camera and/or mic init failed during join call');
|
|
10584
|
+
}
|
|
10580
10585
|
}
|
|
10581
10586
|
// 3. once we have the "joinResponse", and possibly reconciled the local state
|
|
10582
10587
|
// we schedule a fast subscription update for all remote participants
|
|
@@ -11309,61 +11314,65 @@ class Call {
|
|
|
11309
11314
|
}
|
|
11310
11315
|
initCamera() {
|
|
11311
11316
|
var _a, _b, _c;
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
// Set camera direction if it's not yet set
|
|
11317
|
-
// This will also start publishing if camera is enabled
|
|
11318
|
-
if (!this.camera.state.direction && !this.camera.state.selectedDevice) {
|
|
11319
|
-
let defaultDirection = 'front';
|
|
11320
|
-
const backendSetting = (_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.video.camera_facing;
|
|
11321
|
-
if (backendSetting) {
|
|
11322
|
-
defaultDirection = backendSetting === 'front' ? 'front' : 'back';
|
|
11317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11318
|
+
if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream) ||
|
|
11319
|
+
!this.permissionsContext.hasPermission('send-video')) {
|
|
11320
|
+
return;
|
|
11323
11321
|
}
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
.subscribe((stream) => {
|
|
11332
|
-
var _a;
|
|
11333
|
-
if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream)) {
|
|
11334
|
-
this.publishVideoStream(stream);
|
|
11322
|
+
// Set camera direction if it's not yet set
|
|
11323
|
+
// This will also start publishing if camera is enabled
|
|
11324
|
+
if (!this.camera.state.direction && !this.camera.state.selectedDevice) {
|
|
11325
|
+
let defaultDirection = 'front';
|
|
11326
|
+
const backendSetting = (_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.video.camera_facing;
|
|
11327
|
+
if (backendSetting) {
|
|
11328
|
+
defaultDirection = backendSetting === 'front' ? 'front' : 'back';
|
|
11335
11329
|
}
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
|
|
11342
|
-
|
|
11330
|
+
this.camera.selectDirection(defaultDirection);
|
|
11331
|
+
}
|
|
11332
|
+
else if (this.camera.state.status === 'enabled') {
|
|
11333
|
+
// Publish already started media streams (this is the case if there is a lobby screen before join)
|
|
11334
|
+
// Wait for media stream
|
|
11335
|
+
this.camera.state.mediaStream$
|
|
11336
|
+
.pipe(rxjs.takeWhile((s) => s === undefined, true))
|
|
11337
|
+
.subscribe((stream) => {
|
|
11338
|
+
var _a;
|
|
11339
|
+
if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.videoStream)) {
|
|
11340
|
+
this.publishVideoStream(stream);
|
|
11341
|
+
}
|
|
11342
|
+
});
|
|
11343
|
+
}
|
|
11344
|
+
// Apply backend config (this is the case if there is no lobby screen before join)
|
|
11345
|
+
if (this.camera.state.status === undefined &&
|
|
11346
|
+
((_c = this.state.settings) === null || _c === void 0 ? void 0 : _c.video.camera_default_on)) {
|
|
11347
|
+
yield this.camera.enable();
|
|
11348
|
+
}
|
|
11349
|
+
});
|
|
11343
11350
|
}
|
|
11344
11351
|
initMic() {
|
|
11345
11352
|
var _a, _b;
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11352
|
-
|
|
11353
|
-
|
|
11354
|
-
.
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
this.
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
(
|
|
11365
|
-
|
|
11366
|
-
|
|
11353
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
11354
|
+
if (((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream) ||
|
|
11355
|
+
!this.permissionsContext.hasPermission('send-audio')) {
|
|
11356
|
+
return;
|
|
11357
|
+
}
|
|
11358
|
+
// Publish already started media streams (this is the case if there is a lobby screen before join)
|
|
11359
|
+
if (this.microphone.state.status === 'enabled') {
|
|
11360
|
+
// Wait for media stream
|
|
11361
|
+
this.microphone.state.mediaStream$
|
|
11362
|
+
.pipe(rxjs.takeWhile((s) => s === undefined, true))
|
|
11363
|
+
.subscribe((stream) => {
|
|
11364
|
+
var _a;
|
|
11365
|
+
if (!((_a = this.state.localParticipant) === null || _a === void 0 ? void 0 : _a.audioStream)) {
|
|
11366
|
+
this.publishAudioStream(stream);
|
|
11367
|
+
}
|
|
11368
|
+
});
|
|
11369
|
+
}
|
|
11370
|
+
// Apply backend config (this is the case if there is no lobby screen before join)
|
|
11371
|
+
if (this.microphone.state.status === undefined &&
|
|
11372
|
+
((_b = this.state.settings) === null || _b === void 0 ? void 0 : _b.audio.mic_default_on)) {
|
|
11373
|
+
yield this.microphone.enable();
|
|
11374
|
+
}
|
|
11375
|
+
});
|
|
11367
11376
|
}
|
|
11368
11377
|
}
|
|
11369
11378
|
|
|
@@ -12476,7 +12485,7 @@ class WSConnectionFallback {
|
|
|
12476
12485
|
}
|
|
12477
12486
|
}
|
|
12478
12487
|
|
|
12479
|
-
const version = '0.3.
|
|
12488
|
+
const version = '0.3.6';
|
|
12480
12489
|
|
|
12481
12490
|
const logger = getLogger(['location']);
|
|
12482
12491
|
const HINT_URL = `https://hint.stream-io-video.com/`;
|