livekit-client 1.15.4 → 1.15.5

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.
@@ -10414,6 +10414,9 @@ var EngineEvent;
10414
10414
  EngineEvent["ConnectionQualityUpdate"] = "connectionQualityUpdate";
10415
10415
  EngineEvent["SubscriptionError"] = "subscriptionError";
10416
10416
  EngineEvent["SubscriptionPermissionUpdate"] = "subscriptionPermissionUpdate";
10417
+ EngineEvent["RemoteMute"] = "remoteMute";
10418
+ EngineEvent["SubscribedQualityUpdate"] = "subscribedQualityUpdate";
10419
+ EngineEvent["LocalTrackUnpublished"] = "localTrackUnpublished";
10417
10420
  })(EngineEvent || (EngineEvent = {}));
10418
10421
  var TrackEvent;
10419
10422
  (function (TrackEvent) {
@@ -10583,7 +10586,7 @@ function getMatch(exp, ua) {
10583
10586
  return match && match.length >= id && match[id] || '';
10584
10587
  }
10585
10588
 
10586
- var version$1 = "1.15.4";
10589
+ var version$1 = "1.15.5";
10587
10590
 
10588
10591
  const version = version$1;
10589
10592
  const protocolVersion = 11;
@@ -17245,6 +17248,12 @@ class RTCEngine extends eventsExports.EventEmitter {
17245
17248
  this.client.onTokenRefresh = token => {
17246
17249
  this.token = token;
17247
17250
  };
17251
+ this.client.onRemoteMuteChanged = (trackSid, muted) => {
17252
+ this.emit(EngineEvent.RemoteMute, trackSid, muted);
17253
+ };
17254
+ this.client.onSubscribedQualityUpdate = update => {
17255
+ this.emit(EngineEvent.SubscribedQualityUpdate, update);
17256
+ };
17248
17257
  this.client.onClose = () => {
17249
17258
  this.handleDisconnect('signal', ReconnectReason.RR_SIGNAL_DISCONNECTED);
17250
17259
  };
@@ -19372,8 +19381,11 @@ class RemoteVideoTrack extends RemoteTrack {
19372
19381
  }
19373
19382
  const stats = yield this.receiver.getStats();
19374
19383
  let receiverStats;
19384
+ let codecID = '';
19385
+ let codecs = new Map();
19375
19386
  stats.forEach(v => {
19376
19387
  if (v.type === 'inbound-rtp') {
19388
+ codecID = v.codecId;
19377
19389
  receiverStats = {
19378
19390
  type: 'video',
19379
19391
  framesDecoded: v.framesDecoded,
@@ -19391,8 +19403,13 @@ class RemoteVideoTrack extends RemoteTrack {
19391
19403
  bytesReceived: v.bytesReceived,
19392
19404
  decoderImplementation: v.decoderImplementation
19393
19405
  };
19406
+ } else if (v.type === 'codec') {
19407
+ codecs.set(v.id, v);
19394
19408
  }
19395
19409
  });
19410
+ if (receiverStats && codecID !== '' && codecs.get(codecID)) {
19411
+ receiverStats.mimeType = codecs.get(codecID).mimeType;
19412
+ }
19396
19413
  return receiverStats;
19397
19414
  });
19398
19415
  }
@@ -20649,7 +20666,7 @@ class LocalParticipant extends Participant {
20649
20666
  */
20650
20667
  setupEngine(engine) {
20651
20668
  this.engine = engine;
20652
- this.engine.client.onRemoteMuteChanged = (trackSid, muted) => {
20669
+ this.engine.on(EngineEvent.RemoteMute, (trackSid, muted) => {
20653
20670
  const pub = this.tracks.get(trackSid);
20654
20671
  if (!pub || !pub.track) {
20655
20672
  return;
@@ -20659,10 +20676,8 @@ class LocalParticipant extends Participant {
20659
20676
  } else {
20660
20677
  pub.unmute();
20661
20678
  }
20662
- };
20663
- this.engine.client.onSubscribedQualityUpdate = this.handleSubscribedQualityUpdate;
20664
- this.engine.client.onLocalTrackUnpublished = this.handleLocalTrackUnpublished;
20665
- this.engine.on(EngineEvent.Connected, this.handleReconnected).on(EngineEvent.SignalRestarted, this.handleReconnected).on(EngineEvent.SignalResumed, this.handleReconnected).on(EngineEvent.Restarting, this.handleReconnecting).on(EngineEvent.Resuming, this.handleReconnecting).on(EngineEvent.Disconnected, this.handleDisconnected);
20679
+ });
20680
+ this.engine.on(EngineEvent.Connected, this.handleReconnected).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);
20666
20681
  }
20667
20682
  /**
20668
20683
  * Sets and updates the metadata of the local participant.
@@ -22148,7 +22163,7 @@ class Room extends eventsExports.EventEmitter {
22148
22163
  this.localParticipant.activeDeviceMap.set('audioinput', unwrapConstraint(this.options.audioCaptureDefaults.deviceId));
22149
22164
  }
22150
22165
  if ((_a = this.options.audioOutput) === null || _a === void 0 ? void 0 : _a.deviceId) {
22151
- this.switchActiveDevice('audiooutput', unwrapConstraint(this.options.audioOutput.deviceId));
22166
+ this.switchActiveDevice('audiooutput', unwrapConstraint(this.options.audioOutput.deviceId)).catch(e => livekitLogger.warn("Could not set audio output: ".concat(e.message)));
22152
22167
  }
22153
22168
  if (this.options.e2ee) {
22154
22169
  this.setupE2EE();
@@ -22665,6 +22680,7 @@ class Room extends eventsExports.EventEmitter {
22665
22680
  });
22666
22681
  }
22667
22682
  createParticipant(id, info) {
22683
+ var _a;
22668
22684
  let participant;
22669
22685
  if (info) {
22670
22686
  participant = RemoteParticipant.fromParticipantInfo(this.engine.client, info);
@@ -22674,6 +22690,9 @@ class Room extends eventsExports.EventEmitter {
22674
22690
  if (this.options.expWebAudioMix) {
22675
22691
  participant.setAudioContext(this.audioContext);
22676
22692
  }
22693
+ if ((_a = this.options.audioOutput) === null || _a === void 0 ? void 0 : _a.deviceId) {
22694
+ participant.setAudioOutput(this.options.audioOutput).catch(e => livekitLogger.warn("Could not set audio output: ".concat(e.message)));
22695
+ }
22677
22696
  return participant;
22678
22697
  }
22679
22698
  getOrCreateParticipant(id, info) {