livekit-client 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -10539,7 +10539,7 @@ function getOSVersion(ua) {
10539
10539
  return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
10540
10540
  }
10541
10541
 
10542
- var version$1 = "2.4.0";
10542
+ var version$1 = "2.4.1";
10543
10543
 
10544
10544
  const version = version$1;
10545
10545
  const protocolVersion = 13;
@@ -19976,7 +19976,10 @@ class Room extends eventsExports.EventEmitter {
19976
19976
  // trigger the first fetch without waiting for a response
19977
19977
  // if initial connection fails, this will speed up picking regional url
19978
19978
  // on subsequent runs
19979
- this.regionUrlProvider.fetchRegionSettings().catch(e => {
19979
+ this.regionUrlProvider.fetchRegionSettings().then(settings => {
19980
+ var _a;
19981
+ (_a = this.regionUrlProvider) === null || _a === void 0 ? void 0 : _a.setServerReportedRegions(settings);
19982
+ }).catch(e => {
19980
19983
  this.log.warn('could not fetch region settings', Object.assign(Object.assign({}, this.logContext), {
19981
19984
  error: e
19982
19985
  }));
@@ -20546,6 +20549,9 @@ class Room extends eventsExports.EventEmitter {
20546
20549
  this.onLocalParticipantNameChanged = name => {
20547
20550
  this.emit(RoomEvent.ParticipantNameChanged, name, this.localParticipant);
20548
20551
  };
20552
+ this.onLocalAttributesChanged = changedAttributes => {
20553
+ this.emit(RoomEvent.ParticipantAttributesChanged, changedAttributes, this.localParticipant);
20554
+ };
20549
20555
  this.onLocalTrackMuted = pub => {
20550
20556
  this.emit(RoomEvent.TrackMuted, pub, this.localParticipant);
20551
20557
  };
@@ -21034,7 +21040,7 @@ class Room extends eventsExports.EventEmitter {
21034
21040
  });
21035
21041
  }
21036
21042
  setupLocalParticipantEvents() {
21037
- this.localParticipant.on(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).on(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged).on(ParticipantEvent.TrackMuted, this.onLocalTrackMuted).on(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted).on(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished).on(ParticipantEvent.LocalTrackUnpublished, this.onLocalTrackUnpublished).on(ParticipantEvent.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).on(ParticipantEvent.MediaDevicesError, this.onMediaDevicesError).on(ParticipantEvent.AudioStreamAcquired, this.startAudio).on(ParticipantEvent.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged);
21043
+ this.localParticipant.on(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).on(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged).on(ParticipantEvent.AttributesChanged, this.onLocalAttributesChanged).on(ParticipantEvent.TrackMuted, this.onLocalTrackMuted).on(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted).on(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished).on(ParticipantEvent.LocalTrackUnpublished, this.onLocalTrackUnpublished).on(ParticipantEvent.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).on(ParticipantEvent.MediaDevicesError, this.onMediaDevicesError).on(ParticipantEvent.AudioStreamAcquired, this.startAudio).on(ParticipantEvent.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged);
21038
21044
  }
21039
21045
  recreateEngine() {
21040
21046
  var _a;
@@ -21127,7 +21133,7 @@ class Room extends eventsExports.EventEmitter {
21127
21133
  (_b = pub.track) === null || _b === void 0 ? void 0 : _b.stop();
21128
21134
  }
21129
21135
  });
21130
- this.localParticipant.off(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).off(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged).off(ParticipantEvent.TrackMuted, this.onLocalTrackMuted).off(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted).off(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished).off(ParticipantEvent.LocalTrackUnpublished, this.onLocalTrackUnpublished).off(ParticipantEvent.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).off(ParticipantEvent.MediaDevicesError, this.onMediaDevicesError).off(ParticipantEvent.AudioStreamAcquired, this.startAudio).off(ParticipantEvent.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged);
21136
+ this.localParticipant.off(ParticipantEvent.ParticipantMetadataChanged, this.onLocalParticipantMetadataChanged).off(ParticipantEvent.ParticipantNameChanged, this.onLocalParticipantNameChanged).off(ParticipantEvent.AttributesChanged, this.onLocalAttributesChanged).off(ParticipantEvent.TrackMuted, this.onLocalTrackMuted).off(ParticipantEvent.TrackUnmuted, this.onLocalTrackUnmuted).off(ParticipantEvent.LocalTrackPublished, this.onLocalTrackPublished).off(ParticipantEvent.LocalTrackUnpublished, this.onLocalTrackUnpublished).off(ParticipantEvent.ConnectionQualityChanged, this.onLocalConnectionQualityChanged).off(ParticipantEvent.MediaDevicesError, this.onMediaDevicesError).off(ParticipantEvent.AudioStreamAcquired, this.startAudio).off(ParticipantEvent.ParticipantPermissionsChanged, this.onLocalParticipantPermissionsChanged);
21131
21137
  this.localParticipant.trackPublications.clear();
21132
21138
  this.localParticipant.videoTrackPublications.clear();
21133
21139
  this.localParticipant.audioTrackPublications.clear();
@@ -21261,6 +21267,8 @@ class Room extends eventsExports.EventEmitter {
21261
21267
  this.emitWhenConnected(RoomEvent.ParticipantMetadataChanged, metadata, participant);
21262
21268
  }).on(ParticipantEvent.ParticipantNameChanged, name => {
21263
21269
  this.emitWhenConnected(RoomEvent.ParticipantNameChanged, name, participant);
21270
+ }).on(ParticipantEvent.AttributesChanged, changedAttributes => {
21271
+ this.emitWhenConnected(RoomEvent.ParticipantAttributesChanged, changedAttributes, participant);
21264
21272
  }).on(ParticipantEvent.ConnectionQualityChanged, quality => {
21265
21273
  this.emitWhenConnected(RoomEvent.ConnectionQualityChanged, quality, participant);
21266
21274
  }).on(ParticipantEvent.ParticipantPermissionsChanged, prevPermissions => {
@@ -21824,9 +21832,10 @@ class ReconnectCheck extends Checker {
21824
21832
  setTimeout(resolve, 5000);
21825
21833
  reconnectResolver = resolve;
21826
21834
  });
21827
- room.on(RoomEvent.Reconnecting, () => {
21835
+ const handleReconnecting = () => {
21828
21836
  reconnectingTriggered = true;
21829
- }).on(RoomEvent.Reconnected, () => {
21837
+ };
21838
+ room.on(RoomEvent.SignalReconnecting, handleReconnecting).on(RoomEvent.Reconnecting, handleReconnecting).on(RoomEvent.Reconnected, () => {
21830
21839
  reconnected = true;
21831
21840
  reconnectResolver(true);
21832
21841
  });