livekit-client 2.18.5 → 2.18.7

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.
@@ -11744,7 +11744,7 @@ function getMatch(exp, ua) {
11744
11744
  }
11745
11745
  function getOSVersion(ua) {
11746
11746
  return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
11747
- }var version$1 = "2.18.5";const version = version$1;
11747
+ }var version$1 = "2.18.7";const version = version$1;
11748
11748
  const protocolVersion = 16;/** Base error that all LiveKit specific custom errors inherit from. */
11749
11749
  class LivekitError extends Error {
11750
11750
  constructor(code, message, options) {
@@ -18446,7 +18446,8 @@ class LocalTrack extends Track {
18446
18446
  yield this.processor.restart({
18447
18447
  track: newTrack,
18448
18448
  kind: this.kind,
18449
- element: this.processorElement
18449
+ element: this.processorElement,
18450
+ localTrack: this
18450
18451
  });
18451
18452
  processedTrack = this.processor.processedTrack;
18452
18453
  }
@@ -18784,7 +18785,8 @@ class LocalTrack extends Track {
18784
18785
  kind: _this3.kind,
18785
18786
  track: _this3._mediaStreamTrack,
18786
18787
  element: processorElement,
18787
- audioContext: _this3.audioContext
18788
+ audioContext: _this3.audioContext,
18789
+ localTrack: _this3
18788
18790
  };
18789
18791
  yield processor.init(processorOptions);
18790
18792
  _this3.log.debug('processor initialized', _this3.logContext);
@@ -19084,7 +19086,8 @@ class LocalTrack extends Track {
19084
19086
  kind: this.kind,
19085
19087
  track: this._mediaStreamTrack,
19086
19088
  // RN won't have or use AudioContext
19087
- audioContext: this.audioContext
19089
+ audioContext: this.audioContext,
19090
+ localTrack: this
19088
19091
  };
19089
19092
  this.log.debug("setting up audio processor ".concat(processor.name), this.logContext);
19090
19093
  yield processor.init(processorOptions);
@@ -19407,7 +19410,8 @@ function encodingsFromPresets(width, height, presets, sourceFramerate) {
19407
19410
  if (maxFramerate) {
19408
19411
  encoding.maxFramerate = maxFramerate;
19409
19412
  }
19410
- const canSetPriority = isFireFox() || idx === 0;
19413
+ const browser = getBrowser();
19414
+ const canSetPriority = (browser === null || browser === void 0 ? void 0 : browser.name) === 'Firefox' && browser.os !== 'iOS' || idx === 0;
19411
19415
  if (preset.encoding.priority && canSetPriority) {
19412
19416
  encoding.priority = preset.encoding.priority;
19413
19417
  encoding.networkPriority = preset.encoding.priority;
@@ -23180,8 +23184,8 @@ class DataTrackPacketHeader extends Serializable {
23180
23184
  }
23181
23185
  extensionsMetrics() {
23182
23186
  const lengthBytes = this.extensions.toBinaryLengthBytes();
23183
- const lengthWords = Math.ceil(lengthBytes / 4);
23184
- const paddingLengthBytes = lengthWords * 4 - lengthBytes;
23187
+ const lengthWords = Math.ceil((EXT_WORDS_INDICATOR_SIZE + lengthBytes) / 4);
23188
+ const paddingLengthBytes = lengthWords * 4 - EXT_WORDS_INDICATOR_SIZE - lengthBytes;
23185
23189
  return {
23186
23190
  lengthBytes,
23187
23191
  lengthWords,
@@ -23322,7 +23326,7 @@ class DataTrackPacketHeader extends Serializable {
23322
23326
  // field represents the "number of additional bytes" long the extensions section is. This is
23323
23327
  // potentially unintuitive so I wanted to call it out.
23324
23328
  const extensionWords = rtpOrientedExtensionWords + 1;
23325
- let extensionLengthBytes = 4 * extensionWords;
23329
+ let extensionLengthBytes = 4 * extensionWords - EXT_WORDS_INDICATOR_SIZE;
23326
23330
  if (byteIndex + extensionLengthBytes > dataView.byteLength) {
23327
23331
  throw DataTrackDeserializeError.headerOverrun();
23328
23332
  }