@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/dist/index.es.js CHANGED
@@ -6285,7 +6285,7 @@ const getSdkVersion = (sdk) => {
6285
6285
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
6286
6286
  };
6287
6287
 
6288
- const version = "1.46.1";
6288
+ const version = "1.47.0";
6289
6289
  const [major, minor, patch] = version.split('.');
6290
6290
  let sdkInfo = {
6291
6291
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -10866,8 +10866,14 @@ class DeviceManager {
10866
10866
  this.handleDisconnectedOrReplacedDevices();
10867
10867
  }
10868
10868
  if (this.devicePersistence.enabled) {
10869
- this.subscriptions.push(createSubscription(combineLatest([this.state.selectedDevice$, this.state.status$]), ([selectedDevice, status]) => {
10870
- if (!status)
10869
+ this.subscriptions.push(createSubscription(combineLatest([
10870
+ this.state.selectedDevice$,
10871
+ this.state.status$,
10872
+ this.state.browserPermissionState$,
10873
+ ]), ([selectedDevice, status, browserPermissionState]) => {
10874
+ if (!status ||
10875
+ (this.isTrackStoppedDueToTrackEnd && status === 'disabled') ||
10876
+ browserPermissionState !== 'granted')
10871
10877
  return;
10872
10878
  this.persistPreference(selectedDevice, status);
10873
10879
  }));
@@ -11632,7 +11638,10 @@ class CameraManager extends DeviceManager {
11632
11638
  const shouldApplyDefaults = this.state.status === undefined &&
11633
11639
  this.state.optimisticStatus === undefined;
11634
11640
  let persistedPreferencesApplied = false;
11635
- if (shouldApplyDefaults && this.devicePersistence.enabled) {
11641
+ const permissionState = await firstValueFrom(this.state.browserPermissionState$);
11642
+ if (shouldApplyDefaults &&
11643
+ this.devicePersistence.enabled &&
11644
+ permissionState === 'granted') {
11636
11645
  persistedPreferencesApplied =
11637
11646
  await this.applyPersistedPreferences(enabledInCallType);
11638
11647
  }
@@ -12374,7 +12383,10 @@ class MicrophoneManager extends AudioDeviceManager {
12374
12383
  const shouldApplyDefaults = this.state.status === undefined &&
12375
12384
  this.state.optimisticStatus === undefined;
12376
12385
  let persistedPreferencesApplied = false;
12377
- if (shouldApplyDefaults && this.devicePersistence.enabled) {
12386
+ const permissionState = await firstValueFrom(this.state.browserPermissionState$);
12387
+ if (shouldApplyDefaults &&
12388
+ this.devicePersistence.enabled &&
12389
+ permissionState === 'granted') {
12378
12390
  persistedPreferencesApplied = await this.applyPersistedPreferences(true);
12379
12391
  }
12380
12392
  const canPublish = this.call.permissionsContext.canPublish(this.trackType);
@@ -12758,7 +12770,12 @@ class SpeakerManager {
12758
12770
  }));
12759
12771
  }
12760
12772
  if (!isReactNative() && this.devicePersistence.enabled) {
12761
- this.subscriptions.push(createSubscription(this.state.selectedDevice$, (selectedDevice) => {
12773
+ this.subscriptions.push(createSubscription(combineLatest([
12774
+ this.state.selectedDevice$,
12775
+ getAudioBrowserPermission(this.call.tracer).asStateObservable(),
12776
+ ]), ([selectedDevice, browserPermissionState]) => {
12777
+ if (!selectedDevice || browserPermissionState !== 'granted')
12778
+ return;
12762
12779
  this.persistSpeakerDevicePreference(selectedDevice);
12763
12780
  }));
12764
12781
  }
@@ -16133,7 +16150,7 @@ class StreamClient {
16133
16150
  this.getUserAgent = () => {
16134
16151
  if (!this.cachedUserAgent) {
16135
16152
  const { clientAppIdentifier = {} } = this.options;
16136
- const { sdkName = 'js', sdkVersion = "1.46.1", ...extras } = clientAppIdentifier;
16153
+ const { sdkName = 'js', sdkVersion = "1.47.0", ...extras } = clientAppIdentifier;
16137
16154
  this.cachedUserAgent = [
16138
16155
  `stream-video-${sdkName}-v${sdkVersion}`,
16139
16156
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),