livekit-client 1.14.4 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -12045,7 +12045,7 @@ function getMatch(exp, ua) {
12045
12045
  return match && match.length >= id && match[id] || '';
12046
12046
  }
12047
12047
 
12048
- var version$1 = "1.14.4";
12048
+ var version$1 = "1.15.0";
12049
12049
 
12050
12050
  const version = version$1;
12051
12051
  const protocolVersion = 10;
@@ -13133,7 +13133,7 @@ function unpackStreamId(packed) {
13133
13133
  }
13134
13134
  function sleep(duration) {
13135
13135
  return __awaiter(this, void 0, void 0, function* () {
13136
- return new Promise(resolve => setTimeout(resolve, duration));
13136
+ return new Promise(resolve => CriticalTimers.setTimeout(resolve, duration));
13137
13137
  });
13138
13138
  }
13139
13139
  /** @internal */
@@ -13922,6 +13922,7 @@ class SignalClient {
13922
13922
  livekitLogger.debug('received unsupported message');
13923
13923
  return;
13924
13924
  }
13925
+ let pingHandled = false;
13925
13926
  if (msg.case === 'answer') {
13926
13927
  const sd = fromProtoSessionDescription(msg.value);
13927
13928
  if (this.onAnswer) {
@@ -13989,14 +13990,16 @@ class SignalClient {
13989
13990
  if (this.onSubscriptionError) {
13990
13991
  this.onSubscriptionError(msg.value);
13991
13992
  }
13992
- } else if (msg.case === 'pong') {
13993
- this.resetPingTimeout();
13994
- } else if (msg.case === 'pongResp') {
13993
+ } else if (msg.case === 'pong') ; else if (msg.case === 'pongResp') {
13995
13994
  this.rtt = Date.now() - Number.parseInt(msg.value.lastPingTimestamp.toString());
13996
13995
  this.resetPingTimeout();
13996
+ pingHandled = true;
13997
13997
  } else {
13998
13998
  livekitLogger.debug('unsupported message', msg);
13999
13999
  }
14000
+ if (!pingHandled) {
14001
+ this.resetPingTimeout();
14002
+ }
14000
14003
  }
14001
14004
  setReconnected() {
14002
14005
  while (this.queuedRequests.length > 0) {
@@ -14590,6 +14593,7 @@ class LocalTrack extends Track {
14590
14593
  this.attachedElements.forEach(el => {
14591
14594
  detachTrack(this._mediaStreamTrack, el);
14592
14595
  });
14596
+ this.debouncedTrackMuteHandler.cancel('new-track');
14593
14597
  this._mediaStreamTrack.removeEventListener('ended', this.handleEnded);
14594
14598
  this._mediaStreamTrack.removeEventListener('mute', this.handleTrackMuteEvent);
14595
14599
  this._mediaStreamTrack.removeEventListener('unmute', this.handleTrackUnmuteEvent);
@@ -16223,6 +16227,9 @@ class PCTransport extends eventsExports.EventEmitter {
16223
16227
  getRemoteDescription() {
16224
16228
  return this.pc.remoteDescription;
16225
16229
  }
16230
+ getStats() {
16231
+ return this.pc.getStats();
16232
+ }
16226
16233
  getConnectedAddress() {
16227
16234
  var _a;
16228
16235
  return __awaiter(this, void 0, void 0, function* () {
@@ -16434,7 +16441,7 @@ const publishDefaults = {
16434
16441
  screenShareEncoding: ScreenSharePresets.h1080fps15.encoding,
16435
16442
  stopMicTrackOnMute: false,
16436
16443
  videoCodec: defaultVideoCodec,
16437
- backupCodec: false
16444
+ backupCodec: true
16438
16445
  };
16439
16446
  const audioDefaults = {
16440
16447
  autoGainControl: true,