@stream-io/video-client 1.44.5 → 1.45.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.cjs.js CHANGED
@@ -6303,7 +6303,7 @@ const getSdkVersion = (sdk) => {
6303
6303
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
6304
6304
  };
6305
6305
 
6306
- const version = "1.44.5";
6306
+ const version = "1.45.0";
6307
6307
  const [major, minor, patch] = version.split('.');
6308
6308
  let sdkInfo = {
6309
6309
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -9569,11 +9569,14 @@ class AudioBindingsWatchdog {
9569
9569
  for (const p of this.state.participants) {
9570
9570
  if (p.isLocalParticipant)
9571
9571
  continue;
9572
- const { audioStream, screenShareAudioStream, sessionId, userId } = p;
9573
- if (audioStream && !this.bindings.has(toBindingKey(sessionId))) {
9572
+ const { audioStream, screenShareAudioStream, sessionId, userId, publishedTracks, } = p;
9573
+ if (audioStream &&
9574
+ publishedTracks.includes(TrackType.AUDIO) &&
9575
+ !this.bindings.has(toBindingKey(sessionId))) {
9574
9576
  danglingUserIds.push(userId);
9575
9577
  }
9576
9578
  if (screenShareAudioStream &&
9579
+ publishedTracks.includes(TrackType.SCREEN_SHARE_AUDIO) &&
9577
9580
  !this.bindings.has(toBindingKey(sessionId, 'screenShareAudioTrack'))) {
9578
9581
  danglingUserIds.push(userId);
9579
9582
  }
@@ -11207,6 +11210,7 @@ class DeviceManager {
11207
11210
  isDeviceReplaced = true;
11208
11211
  }
11209
11212
  if (isDeviceDisconnected) {
11213
+ this.dispatchDeviceDisconnectedEvent(prevDevice);
11210
11214
  await this.disable();
11211
11215
  await this.select(undefined);
11212
11216
  }
@@ -11216,7 +11220,7 @@ class DeviceManager {
11216
11220
  await this.enable();
11217
11221
  this.isTrackStoppedDueToTrackEnd = false;
11218
11222
  }
11219
- else {
11223
+ else if (!hasPending(this.statusChangeConcurrencyTag)) {
11220
11224
  await this.applySettingsToStream();
11221
11225
  }
11222
11226
  }
@@ -11230,6 +11234,20 @@ class DeviceManager {
11230
11234
  const kind = this.mediaDeviceKind;
11231
11235
  return devices.find((d) => d.deviceId === deviceId && d.kind === kind);
11232
11236
  }
11237
+ dispatchDeviceDisconnectedEvent(device) {
11238
+ const event = {
11239
+ type: 'device.disconnected',
11240
+ call_cid: this.call.cid,
11241
+ status: this.isTrackStoppedDueToTrackEnd
11242
+ ? this.state.prevStatus
11243
+ : this.state.status,
11244
+ deviceId: device.deviceId,
11245
+ label: device.label,
11246
+ kind: device.kind,
11247
+ };
11248
+ this.call.tracer.trace('device.disconnected', event);
11249
+ this.call.streamClient.dispatchEvent(event);
11250
+ }
11233
11251
  persistPreference(selectedDevice, status) {
11234
11252
  const deviceKind = this.mediaDeviceKind;
11235
11253
  const deviceKey = deviceKind === 'audioinput' ? 'microphone' : 'camera';
@@ -15997,7 +16015,7 @@ class StreamClient {
15997
16015
  this.getUserAgent = () => {
15998
16016
  if (!this.cachedUserAgent) {
15999
16017
  const { clientAppIdentifier = {} } = this.options;
16000
- const { sdkName = 'js', sdkVersion = "1.44.5", ...extras } = clientAppIdentifier;
16018
+ const { sdkName = 'js', sdkVersion = "1.45.0", ...extras } = clientAppIdentifier;
16001
16019
  this.cachedUserAgent = [
16002
16020
  `stream-video-${sdkName}-v${sdkVersion}`,
16003
16021
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),