@stream-io/video-client 1.46.1 → 1.47.0
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 +10 -0
- package/dist/index.browser.es.js +24 -7
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +24 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +24 -7
- package/dist/index.es.js.map +1 -1
- package/dist/src/gen/coordinator/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/devices/CameraManager.ts +9 -2
- package/src/devices/DeviceManager.ts +13 -3
- package/src/devices/MicrophoneManager.ts +8 -1
- package/src/devices/SpeakerManager.ts +16 -4
- package/src/devices/__tests__/CameraManager.test.ts +32 -0
- package/src/devices/__tests__/DeviceManager.test.ts +71 -0
- package/src/devices/__tests__/MicrophoneManager.test.ts +23 -0
- package/src/devices/__tests__/SpeakerManager.test.ts +28 -0
- package/src/gen/coordinator/index.ts +6 -0
package/dist/index.cjs.js
CHANGED
|
@@ -6304,7 +6304,7 @@ const getSdkVersion = (sdk) => {
|
|
|
6304
6304
|
return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
|
|
6305
6305
|
};
|
|
6306
6306
|
|
|
6307
|
-
const version = "1.
|
|
6307
|
+
const version = "1.47.0";
|
|
6308
6308
|
const [major, minor, patch] = version.split('.');
|
|
6309
6309
|
let sdkInfo = {
|
|
6310
6310
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -10885,8 +10885,14 @@ class DeviceManager {
|
|
|
10885
10885
|
this.handleDisconnectedOrReplacedDevices();
|
|
10886
10886
|
}
|
|
10887
10887
|
if (this.devicePersistence.enabled) {
|
|
10888
|
-
this.subscriptions.push(createSubscription(rxjs.combineLatest([
|
|
10889
|
-
|
|
10888
|
+
this.subscriptions.push(createSubscription(rxjs.combineLatest([
|
|
10889
|
+
this.state.selectedDevice$,
|
|
10890
|
+
this.state.status$,
|
|
10891
|
+
this.state.browserPermissionState$,
|
|
10892
|
+
]), ([selectedDevice, status, browserPermissionState]) => {
|
|
10893
|
+
if (!status ||
|
|
10894
|
+
(this.isTrackStoppedDueToTrackEnd && status === 'disabled') ||
|
|
10895
|
+
browserPermissionState !== 'granted')
|
|
10890
10896
|
return;
|
|
10891
10897
|
this.persistPreference(selectedDevice, status);
|
|
10892
10898
|
}));
|
|
@@ -11651,7 +11657,10 @@ class CameraManager extends DeviceManager {
|
|
|
11651
11657
|
const shouldApplyDefaults = this.state.status === undefined &&
|
|
11652
11658
|
this.state.optimisticStatus === undefined;
|
|
11653
11659
|
let persistedPreferencesApplied = false;
|
|
11654
|
-
|
|
11660
|
+
const permissionState = await rxjs.firstValueFrom(this.state.browserPermissionState$);
|
|
11661
|
+
if (shouldApplyDefaults &&
|
|
11662
|
+
this.devicePersistence.enabled &&
|
|
11663
|
+
permissionState === 'granted') {
|
|
11655
11664
|
persistedPreferencesApplied =
|
|
11656
11665
|
await this.applyPersistedPreferences(enabledInCallType);
|
|
11657
11666
|
}
|
|
@@ -12393,7 +12402,10 @@ class MicrophoneManager extends AudioDeviceManager {
|
|
|
12393
12402
|
const shouldApplyDefaults = this.state.status === undefined &&
|
|
12394
12403
|
this.state.optimisticStatus === undefined;
|
|
12395
12404
|
let persistedPreferencesApplied = false;
|
|
12396
|
-
|
|
12405
|
+
const permissionState = await rxjs.firstValueFrom(this.state.browserPermissionState$);
|
|
12406
|
+
if (shouldApplyDefaults &&
|
|
12407
|
+
this.devicePersistence.enabled &&
|
|
12408
|
+
permissionState === 'granted') {
|
|
12397
12409
|
persistedPreferencesApplied = await this.applyPersistedPreferences(true);
|
|
12398
12410
|
}
|
|
12399
12411
|
const canPublish = this.call.permissionsContext.canPublish(this.trackType);
|
|
@@ -12777,7 +12789,12 @@ class SpeakerManager {
|
|
|
12777
12789
|
}));
|
|
12778
12790
|
}
|
|
12779
12791
|
if (!isReactNative() && this.devicePersistence.enabled) {
|
|
12780
|
-
this.subscriptions.push(createSubscription(
|
|
12792
|
+
this.subscriptions.push(createSubscription(rxjs.combineLatest([
|
|
12793
|
+
this.state.selectedDevice$,
|
|
12794
|
+
getAudioBrowserPermission(this.call.tracer).asStateObservable(),
|
|
12795
|
+
]), ([selectedDevice, browserPermissionState]) => {
|
|
12796
|
+
if (!selectedDevice || browserPermissionState !== 'granted')
|
|
12797
|
+
return;
|
|
12781
12798
|
this.persistSpeakerDevicePreference(selectedDevice);
|
|
12782
12799
|
}));
|
|
12783
12800
|
}
|
|
@@ -16152,7 +16169,7 @@ class StreamClient {
|
|
|
16152
16169
|
this.getUserAgent = () => {
|
|
16153
16170
|
if (!this.cachedUserAgent) {
|
|
16154
16171
|
const { clientAppIdentifier = {} } = this.options;
|
|
16155
|
-
const { sdkName = 'js', sdkVersion = "1.
|
|
16172
|
+
const { sdkName = 'js', sdkVersion = "1.47.0", ...extras } = clientAppIdentifier;
|
|
16156
16173
|
this.cachedUserAgent = [
|
|
16157
16174
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
16158
16175
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|