livekit-client 1.2.6 → 1.2.9

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.
@@ -10357,7 +10357,7 @@ function computeBitrate(currentStats, prevStats) {
10357
10357
  return (bytesNow - bytesPrev) * 8 * 1000 / (currentStats.timestamp - prevStats.timestamp);
10358
10358
  }
10359
10359
 
10360
- var version$1 = "1.2.6";
10360
+ var version$1 = "1.2.9";
10361
10361
 
10362
10362
  const version = version$1;
10363
10363
  const protocolVersion = 8;
@@ -12558,8 +12558,6 @@ class RemoteAudioTrack extends RemoteTrack {
12558
12558
  this.monitorReceiver();
12559
12559
  }, monitorFrequency);
12560
12560
  };
12561
-
12562
- this.elementVolume = 1;
12563
12561
  }
12564
12562
  /**
12565
12563
  * sets the volume for all attached audio elements
@@ -12574,12 +12572,22 @@ class RemoteAudioTrack extends RemoteTrack {
12574
12572
  this.elementVolume = volume;
12575
12573
  }
12576
12574
  /**
12577
- * gets the volume for all attached audio elements
12575
+ * gets the volume of attached audio elements (loudest)
12578
12576
  */
12579
12577
 
12580
12578
 
12581
12579
  getVolume() {
12582
- return this.elementVolume;
12580
+ if (this.elementVolume) {
12581
+ return this.elementVolume;
12582
+ }
12583
+
12584
+ let highestVolume = 0;
12585
+ this.attachedElements.forEach(element => {
12586
+ if (element.volume > highestVolume) {
12587
+ highestVolume = element.volume;
12588
+ }
12589
+ });
12590
+ return highestVolume;
12583
12591
  }
12584
12592
 
12585
12593
  attach(element) {
@@ -12589,7 +12597,10 @@ class RemoteAudioTrack extends RemoteTrack {
12589
12597
  super.attach(element);
12590
12598
  }
12591
12599
 
12592
- element.volume = this.elementVolume;
12600
+ if (this.elementVolume) {
12601
+ element.volume = this.elementVolume;
12602
+ }
12603
+
12593
12604
  return element;
12594
12605
  }
12595
12606
 
@@ -13898,6 +13909,7 @@ class RemoteTrackPublication extends TrackPublication {
13898
13909
  prevTrack.off(TrackEvent.VideoDimensionsChanged, this.handleVideoDimensionsChange);
13899
13910
  prevTrack.off(TrackEvent.VisibilityChanged, this.handleVisibilityChange);
13900
13911
  prevTrack.off(TrackEvent.Ended, this.handleEnded);
13912
+ prevTrack.detach();
13901
13913
  }
13902
13914
 
13903
13915
  super.setTrack(track);
@@ -21766,9 +21778,9 @@ class Room extends events.exports.EventEmitter {
21766
21778
  if (this.connectFuture === this.reconnectFuture) {
21767
21779
  (_a = this.connectFuture) === null || _a === void 0 ? void 0 : _a.reject(undefined);
21768
21780
  this.connectFuture = undefined;
21769
- this.reconnectFuture = undefined;
21770
21781
  }
21771
21782
 
21783
+ this.reconnectFuture = undefined;
21772
21784
  this.participants.forEach(p => {
21773
21785
  p.tracks.forEach(pub => {
21774
21786
  p.unpublishTrack(pub.trackSid);