livekit-client 2.15.2 → 2.15.3

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.
@@ -11364,7 +11364,7 @@ function getOSVersion(ua) {
11364
11364
  return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
11365
11365
  }
11366
11366
 
11367
- var version$1 = "2.15.2";
11367
+ var version$1 = "2.15.3";
11368
11368
 
11369
11369
  const version = version$1;
11370
11370
  const protocolVersion = 16;
@@ -12167,7 +12167,11 @@ function getEmptyAudioStreamTrack() {
12167
12167
  return emptyAudioStreamTrack.clone();
12168
12168
  }
12169
12169
  class Future {
12170
+ get isResolved() {
12171
+ return this._isResolved;
12172
+ }
12170
12173
  constructor(futureBase, onFinally) {
12174
+ this._isResolved = false;
12171
12175
  this.onFinally = onFinally;
12172
12176
  this.promise = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
12173
12177
  this.resolve = resolve;
@@ -12177,7 +12181,8 @@ class Future {
12177
12181
  }
12178
12182
  })).finally(() => {
12179
12183
  var _a;
12180
- return (_a = this.onFinally) === null || _a === void 0 ? void 0 : _a.call(this);
12184
+ this._isResolved = true;
12185
+ (_a = this.onFinally) === null || _a === void 0 ? void 0 : _a.call(this);
12181
12186
  });
12182
12187
  }
12183
12188
  }
@@ -15027,7 +15032,7 @@ class PCTransport extends eventsExports.EventEmitter {
15027
15032
  if (codecPayload === 0) {
15028
15033
  return true;
15029
15034
  }
15030
- if (isSVCCodec(trackbr.codec)) {
15035
+ if (isSVCCodec(trackbr.codec) && !isSafari()) {
15031
15036
  this.ensureVideoDDExtensionForSVC(media, sdpParsed);
15032
15037
  }
15033
15038
  // TODO: av1 slow starting issue already fixed in chrome 124, clean this after some versions
@@ -16333,9 +16338,25 @@ class LocalTrack extends Track {
16333
16338
  }
16334
16339
  attachToElement(_this3._mediaStreamTrack, processorElement);
16335
16340
  processorElement.muted = true;
16336
- processorElement.play().catch(error => _this3.log.error('failed to play processor element', Object.assign(Object.assign({}, _this3.logContext), {
16337
- error
16338
- })));
16341
+ processorElement.play().catch(error => {
16342
+ if (error instanceof DOMException && error.name === 'AbortError') {
16343
+ // This happens on Safari when the processor is restarted, try again after a delay
16344
+ _this3.log.warn('failed to play processor element, retrying', Object.assign(Object.assign({}, _this3.logContext), {
16345
+ error
16346
+ }));
16347
+ setTimeout(() => {
16348
+ processorElement.play().catch(err => {
16349
+ _this3.log.error('failed to play processor element', Object.assign(Object.assign({}, _this3.logContext), {
16350
+ err
16351
+ }));
16352
+ });
16353
+ }, 100);
16354
+ } else {
16355
+ _this3.log.error('failed to play processor element', Object.assign(Object.assign({}, _this3.logContext), {
16356
+ error
16357
+ }));
16358
+ }
16359
+ });
16339
16360
  _this3.processor = processor;
16340
16361
  _this3.processorElement = processorElement;
16341
16362
  if (_this3.processor.processedTrack) {
@@ -20748,6 +20769,7 @@ class LocalParticipant extends Participant {
20748
20769
  * @internal
20749
20770
  */
20750
20771
  setupEngine(engine) {
20772
+ var _a;
20751
20773
  this.engine = engine;
20752
20774
  this.engine.on(EngineEvent.RemoteMute, (trackSid, muted) => {
20753
20775
  const pub = this.trackPublications.get(trackSid);
@@ -20760,6 +20782,9 @@ class LocalParticipant extends Participant {
20760
20782
  pub.unmute();
20761
20783
  }
20762
20784
  });
20785
+ if ((_a = this.signalConnectedFuture) === null || _a === void 0 ? void 0 : _a.isResolved) {
20786
+ this.signalConnectedFuture = undefined;
20787
+ }
20763
20788
  this.engine.on(EngineEvent.Connected, this.handleReconnected).on(EngineEvent.SignalConnected, this.handleSignalConnected).on(EngineEvent.SignalRestarted, this.handleReconnected).on(EngineEvent.SignalResumed, this.handleReconnected).on(EngineEvent.Restarting, this.handleReconnecting).on(EngineEvent.Resuming, this.handleReconnecting).on(EngineEvent.LocalTrackUnpublished, this.handleLocalTrackUnpublished).on(EngineEvent.SubscribedQualityUpdate, this.handleSubscribedQualityUpdate).on(EngineEvent.Disconnected, this.handleDisconnected).on(EngineEvent.SignalRequestResponse, this.handleSignalRequestResponse).on(EngineEvent.DataPacketReceived, this.handleDataPacket);
20764
20789
  }
20765
20790
  /**