@stream-io/video-client 0.3.5 → 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 +7 -0
- package/dist/index.browser.es.js +63 -54
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +63 -54
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +63 -54
- 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/devices/InputMediaDeviceManager.ts +1 -1
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +17 -0
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
|
+
### [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
|
+
|
|
5
12
|
### [0.3.5](https://github.com/GetStream/stream-video-js/compare/client0.3.4...client0.3.5) (2023-08-22)
|
|
6
13
|
|
|
7
14
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -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
|
-
|
|
10556
|
-
|
|
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
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
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
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
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
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
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
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
.
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11335
|
-
this.
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11340
|
-
|
|
11341
|
-
(
|
|
11342
|
-
|
|
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.
|
|
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/`;
|