@stream-io/video-client 1.25.0 → 1.25.1

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
@@ -5811,7 +5811,7 @@ const aggregate = (stats) => {
5811
5811
  return report;
5812
5812
  };
5813
5813
 
5814
- const version = "1.25.0";
5814
+ const version = "1.25.1";
5815
5815
  const [major, minor, patch] = version.split('.');
5816
5816
  let sdkInfo = {
5817
5817
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -9684,6 +9684,7 @@ class InputMediaDeviceManager {
9684
9684
  */
9685
9685
  this.stopOnLeave = true;
9686
9686
  this.subscriptions = [];
9687
+ this.areSubscriptionsSetUp = false;
9687
9688
  this.isTrackStoppedDueToTrackEnd = false;
9688
9689
  this.filters = [];
9689
9690
  this.statusChangeConcurrencyTag = Symbol('statusChangeConcurrencyTag');
@@ -9695,11 +9696,20 @@ class InputMediaDeviceManager {
9695
9696
  */
9696
9697
  this.dispose = () => {
9697
9698
  this.subscriptions.forEach((s) => s());
9699
+ this.subscriptions = [];
9700
+ this.areSubscriptionsSetUp = false;
9698
9701
  };
9699
9702
  this.call = call;
9700
9703
  this.state = state;
9701
9704
  this.trackType = trackType;
9702
9705
  this.logger = getLogger([`${TrackType[trackType].toLowerCase()} manager`]);
9706
+ this.setup();
9707
+ }
9708
+ setup() {
9709
+ if (this.areSubscriptionsSetUp) {
9710
+ return;
9711
+ }
9712
+ this.areSubscriptionsSetUp = true;
9703
9713
  if (deviceIds$ &&
9704
9714
  !isReactNative() &&
9705
9715
  (this.trackType === TrackType.AUDIO || this.trackType === TrackType.VIDEO)) {
@@ -10660,6 +10670,9 @@ class MicrophoneManager extends InputMediaDeviceManager {
10660
10670
  super(call, new MicrophoneManagerState(disableMode), TrackType.AUDIO);
10661
10671
  this.speakingWhileMutedNotificationEnabled = true;
10662
10672
  this.soundDetectorConcurrencyTag = Symbol('soundDetectorConcurrencyTag');
10673
+ }
10674
+ setup() {
10675
+ super.setup();
10663
10676
  this.subscriptions.push(createSafeAsyncSubscription(combineLatest([
10664
10677
  this.call.state.callingState$,
10665
10678
  this.call.state.ownCapabilities$,
@@ -10937,7 +10950,10 @@ class ScreenShareState extends InputMediaDeviceManagerState {
10937
10950
  class ScreenShareManager extends InputMediaDeviceManager {
10938
10951
  constructor(call) {
10939
10952
  super(call, new ScreenShareState(), TrackType.SCREEN_SHARE);
10940
- this.subscriptions.push(createSubscription(call.state.settings$, (settings) => {
10953
+ }
10954
+ setup() {
10955
+ super.setup();
10956
+ this.subscriptions.push(createSubscription(this.call.state.settings$, (settings) => {
10941
10957
  const maybeTargetResolution = settings?.screensharing.target_resolution;
10942
10958
  if (maybeTargetResolution) {
10943
10959
  this.setDefaultConstraints({
@@ -11060,6 +11076,7 @@ class SpeakerState {
11060
11076
  class SpeakerManager {
11061
11077
  constructor(call) {
11062
11078
  this.subscriptions = [];
11079
+ this.areSubscriptionsSetUp = false;
11063
11080
  /**
11064
11081
  * Disposes the manager.
11065
11082
  *
@@ -11067,9 +11084,18 @@ class SpeakerManager {
11067
11084
  */
11068
11085
  this.dispose = () => {
11069
11086
  this.subscriptions.forEach((s) => s.unsubscribe());
11087
+ this.subscriptions = [];
11088
+ this.areSubscriptionsSetUp = false;
11070
11089
  };
11071
11090
  this.call = call;
11072
11091
  this.state = new SpeakerState(call.tracer);
11092
+ this.setup();
11093
+ }
11094
+ setup() {
11095
+ if (this.areSubscriptionsSetUp) {
11096
+ return;
11097
+ }
11098
+ this.areSubscriptionsSetUp = true;
11073
11099
  if (deviceIds$ && !isReactNative()) {
11074
11100
  this.subscriptions.push(combineLatest([deviceIds$, this.state.selectedDevice$]).subscribe(([devices, deviceId]) => {
11075
11101
  if (!deviceId) {
@@ -11211,6 +11237,10 @@ class Call {
11211
11237
  this.leaveCallHooks.add(registerEventHandlers(this, this.dispatcher));
11212
11238
  this.registerEffects();
11213
11239
  this.registerReconnectHandlers();
11240
+ this.camera.setup();
11241
+ this.microphone.setup();
11242
+ this.screenShare.setup();
11243
+ this.speaker.setup();
11214
11244
  if (this.state.callingState === CallingState.LEFT) {
11215
11245
  this.state.setCallingState(CallingState.IDLE);
11216
11246
  }
@@ -11449,6 +11479,7 @@ class Call {
11449
11479
  this.microphone.dispose();
11450
11480
  this.screenShare.dispose();
11451
11481
  this.speaker.dispose();
11482
+ this.deviceSettingsAppliedOnce = false;
11452
11483
  const stopOnLeavePromises = [];
11453
11484
  if (this.camera.stopOnLeave) {
11454
11485
  stopOnLeavePromises.push(this.camera.disable(true));
@@ -14220,7 +14251,7 @@ class StreamClient {
14220
14251
  this.getUserAgent = () => {
14221
14252
  if (!this.cachedUserAgent) {
14222
14253
  const { clientAppIdentifier = {} } = this.options;
14223
- const { sdkName = 'js', sdkVersion = "1.25.0", ...extras } = clientAppIdentifier;
14254
+ const { sdkName = 'js', sdkVersion = "1.25.1", ...extras } = clientAppIdentifier;
14224
14255
  this.cachedUserAgent = [
14225
14256
  `stream-video-${sdkName}-v${sdkVersion}`,
14226
14257
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),