livekit-client 2.0.8 → 2.0.10

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.
@@ -12538,7 +12538,8 @@ const KEY_PROVIDER_DEFAULTS = {
12538
12538
  sharedKey: false,
12539
12539
  ratchetSalt: SALT,
12540
12540
  ratchetWindowSize: 8,
12541
- failureTolerance: DECRYPTION_FAILURE_TOLERANCE
12541
+ failureTolerance: DECRYPTION_FAILURE_TOLERANCE,
12542
+ keyringSize: 16
12542
12543
  };
12543
12544
 
12544
12545
  var KeyProviderEvent;
@@ -13473,7 +13474,7 @@ function getMatch(exp, ua) {
13473
13474
  return match && match.length >= id && match[id] || '';
13474
13475
  }
13475
13476
 
13476
- var version$1 = "2.0.8";
13477
+ var version$1 = "2.0.10";
13477
13478
 
13478
13479
  const version = version$1;
13479
13480
  const protocolVersion = 12;
@@ -15037,6 +15038,7 @@ class LocalTrack extends Track {
15037
15038
  const unlock = yield this.processorLock.lock();
15038
15039
  try {
15039
15040
  this.log.debug('setting up processor', this.logContext);
15041
+ this.processorElement = (_a = this.processorElement) !== null && _a !== void 0 ? _a : document.createElement(this.kind);
15040
15042
  const processorOptions = {
15041
15043
  kind: this.kind,
15042
15044
  track: this._mediaStreamTrack,
@@ -15050,7 +15052,6 @@ class LocalTrack extends Track {
15050
15052
  if (this.kind === 'unknown') {
15051
15053
  throw TypeError('cannot set processor on track of unknown kind');
15052
15054
  }
15053
- this.processorElement = (_a = this.processorElement) !== null && _a !== void 0 ? _a : document.createElement(this.kind);
15054
15055
  attachToElement(this._mediaStreamTrack, this.processorElement);
15055
15056
  this.processorElement.muted = true;
15056
15057
  this.processorElement.play().catch(error => this.log.error('failed to play processor element', Object.assign(Object.assign({}, this.logContext), {
@@ -18175,12 +18176,13 @@ class RTCEngine extends eventsExports.EventEmitter {
18175
18176
  this.reliableDC.onbufferedamountlow = this.handleBufferedAmountLow;
18176
18177
  }
18177
18178
  setPreferredCodec(transceiver, kind, videoCodec) {
18178
- if (!('getCapabilities' in RTCRtpSender)) {
18179
+ if (!('getCapabilities' in RTCRtpReceiver)) {
18179
18180
  return;
18180
18181
  }
18181
- const cap = RTCRtpSender.getCapabilities(kind);
18182
+ // when setting codec preferences, the capabilites need to be read from the RTCRtpReceiver
18183
+ const cap = RTCRtpReceiver.getCapabilities(kind);
18182
18184
  if (!cap) return;
18183
- this.log.debug('get sender capabilities', Object.assign(Object.assign({}, this.logContext), {
18185
+ this.log.debug('get receiver capabilities', Object.assign(Object.assign({}, this.logContext), {
18184
18186
  cap
18185
18187
  }));
18186
18188
  const matched = [];
@@ -19533,17 +19535,20 @@ class LocalVideoTrack extends LocalTrack {
19533
19535
  streamId: v.id,
19534
19536
  frameHeight: v.frameHeight,
19535
19537
  frameWidth: v.frameWidth,
19538
+ framesPerSecond: v.framesPerSecond,
19539
+ framesSent: v.framesSent,
19536
19540
  firCount: v.firCount,
19537
19541
  pliCount: v.pliCount,
19538
19542
  nackCount: v.nackCount,
19539
19543
  packetsSent: v.packetsSent,
19540
19544
  bytesSent: v.bytesSent,
19541
- framesSent: v.framesSent,
19542
- timestamp: v.timestamp,
19545
+ qualityLimitationReason: v.qualityLimitationReason,
19546
+ qualityLimitationDurations: v.qualityLimitationDurations,
19547
+ qualityLimitationResolutionChanges: v.qualityLimitationResolutionChanges,
19543
19548
  rid: (_a = v.rid) !== null && _a !== void 0 ? _a : v.id,
19544
19549
  retransmittedPacketsSent: v.retransmittedPacketsSent,
19545
- qualityLimitationReason: v.qualityLimitationReason,
19546
- qualityLimitationResolutionChanges: v.qualityLimitationResolutionChanges
19550
+ targetBitrate: v.targetBitrate,
19551
+ timestamp: v.timestamp
19547
19552
  };
19548
19553
  // locate the appropriate remote-inbound-rtp item
19549
19554
  const r = stats.get(v.remoteId);
@@ -19555,6 +19560,11 @@ class LocalVideoTrack extends LocalTrack {
19555
19560
  items.push(vs);
19556
19561
  }
19557
19562
  });
19563
+ // make sure highest res layer is always first
19564
+ items.sort((a, b) => {
19565
+ var _a, _b;
19566
+ return ((_a = b.frameWidth) !== null && _a !== void 0 ? _a : 0) - ((_b = a.frameWidth) !== null && _b !== void 0 ? _b : 0);
19567
+ });
19558
19568
  return items;
19559
19569
  });
19560
19570
  }