@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.es.js CHANGED
@@ -6284,7 +6284,7 @@ const getSdkVersion = (sdk) => {
6284
6284
  return sdk ? `${sdk.major}.${sdk.minor}.${sdk.patch}` : '0.0.0-development';
6285
6285
  };
6286
6286
 
6287
- const version = "1.44.5";
6287
+ const version = "1.45.0";
6288
6288
  const [major, minor, patch] = version.split('.');
6289
6289
  let sdkInfo = {
6290
6290
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -9550,11 +9550,14 @@ class AudioBindingsWatchdog {
9550
9550
  for (const p of this.state.participants) {
9551
9551
  if (p.isLocalParticipant)
9552
9552
  continue;
9553
- const { audioStream, screenShareAudioStream, sessionId, userId } = p;
9554
- if (audioStream && !this.bindings.has(toBindingKey(sessionId))) {
9553
+ const { audioStream, screenShareAudioStream, sessionId, userId, publishedTracks, } = p;
9554
+ if (audioStream &&
9555
+ publishedTracks.includes(TrackType.AUDIO) &&
9556
+ !this.bindings.has(toBindingKey(sessionId))) {
9555
9557
  danglingUserIds.push(userId);
9556
9558
  }
9557
9559
  if (screenShareAudioStream &&
9560
+ publishedTracks.includes(TrackType.SCREEN_SHARE_AUDIO) &&
9558
9561
  !this.bindings.has(toBindingKey(sessionId, 'screenShareAudioTrack'))) {
9559
9562
  danglingUserIds.push(userId);
9560
9563
  }
@@ -11188,6 +11191,7 @@ class DeviceManager {
11188
11191
  isDeviceReplaced = true;
11189
11192
  }
11190
11193
  if (isDeviceDisconnected) {
11194
+ this.dispatchDeviceDisconnectedEvent(prevDevice);
11191
11195
  await this.disable();
11192
11196
  await this.select(undefined);
11193
11197
  }
@@ -11197,7 +11201,7 @@ class DeviceManager {
11197
11201
  await this.enable();
11198
11202
  this.isTrackStoppedDueToTrackEnd = false;
11199
11203
  }
11200
- else {
11204
+ else if (!hasPending(this.statusChangeConcurrencyTag)) {
11201
11205
  await this.applySettingsToStream();
11202
11206
  }
11203
11207
  }
@@ -11211,6 +11215,20 @@ class DeviceManager {
11211
11215
  const kind = this.mediaDeviceKind;
11212
11216
  return devices.find((d) => d.deviceId === deviceId && d.kind === kind);
11213
11217
  }
11218
+ dispatchDeviceDisconnectedEvent(device) {
11219
+ const event = {
11220
+ type: 'device.disconnected',
11221
+ call_cid: this.call.cid,
11222
+ status: this.isTrackStoppedDueToTrackEnd
11223
+ ? this.state.prevStatus
11224
+ : this.state.status,
11225
+ deviceId: device.deviceId,
11226
+ label: device.label,
11227
+ kind: device.kind,
11228
+ };
11229
+ this.call.tracer.trace('device.disconnected', event);
11230
+ this.call.streamClient.dispatchEvent(event);
11231
+ }
11214
11232
  persistPreference(selectedDevice, status) {
11215
11233
  const deviceKind = this.mediaDeviceKind;
11216
11234
  const deviceKey = deviceKind === 'audioinput' ? 'microphone' : 'camera';
@@ -15978,7 +15996,7 @@ class StreamClient {
15978
15996
  this.getUserAgent = () => {
15979
15997
  if (!this.cachedUserAgent) {
15980
15998
  const { clientAppIdentifier = {} } = this.options;
15981
- const { sdkName = 'js', sdkVersion = "1.44.5", ...extras } = clientAppIdentifier;
15999
+ const { sdkName = 'js', sdkVersion = "1.45.0", ...extras } = clientAppIdentifier;
15982
16000
  this.cachedUserAgent = [
15983
16001
  `stream-video-${sdkName}-v${sdkVersion}`,
15984
16002
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),