livekit-client 1.15.4 → 1.15.6

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.6";
10587
10590
 
10588
10591
  const version = version$1;
10589
10592
  const protocolVersion = 11;
@@ -14036,6 +14039,8 @@ class LocalTrack extends Track {
14036
14039
  throw TypeError('cannot set processor on track of unknown kind');
14037
14040
  }
14038
14041
  attachToElement(newTrack, this.processorElement);
14042
+ // ensure the processorElement itself stays muted
14043
+ this.processorElement.muted = true;
14039
14044
  yield this.processor.restart({
14040
14045
  track: newTrack,
14041
14046
  kind: this.kind,
@@ -14291,8 +14296,8 @@ class LocalTrack extends Track {
14291
14296
  throw TypeError('cannot set processor on track of unknown kind');
14292
14297
  }
14293
14298
  this.processorElement = (_a = this.processorElement) !== null && _a !== void 0 ? _a : document.createElement(this.kind);
14294
- this.processorElement.muted = true;
14295
14299
  attachToElement(this._mediaStreamTrack, this.processorElement);
14300
+ this.processorElement.muted = true;
14296
14301
  this.processorElement.play().catch(error => livekitLogger.error('failed to play processor element', {
14297
14302
  error
14298
14303
  }));
@@ -17245,6 +17250,12 @@ class RTCEngine extends eventsExports.EventEmitter {
17245
17250
  this.client.onTokenRefresh = token => {
17246
17251
  this.token = token;
17247
17252
  };
17253
+ this.client.onRemoteMuteChanged = (trackSid, muted) => {
17254
+ this.emit(EngineEvent.RemoteMute, trackSid, muted);
17255
+ };
17256
+ this.client.onSubscribedQualityUpdate = update => {
17257
+ this.emit(EngineEvent.SubscribedQualityUpdate, update);
17258
+ };
17248
17259
  this.client.onClose = () => {
17249
17260
  this.handleDisconnect('signal', ReconnectReason.RR_SIGNAL_DISCONNECTED);
17250
17261
  };
@@ -19372,8 +19383,11 @@ class RemoteVideoTrack extends RemoteTrack {
19372
19383
  }
19373
19384
  const stats = yield this.receiver.getStats();
19374
19385
  let receiverStats;
19386
+ let codecID = '';
19387
+ let codecs = new Map();
19375
19388
  stats.forEach(v => {
19376
19389
  if (v.type === 'inbound-rtp') {
19390
+ codecID = v.codecId;
19377
19391
  receiverStats = {
19378
19392
  type: 'video',
19379
19393
  framesDecoded: v.framesDecoded,
@@ -19391,8 +19405,13 @@ class RemoteVideoTrack extends RemoteTrack {
19391
19405
  bytesReceived: v.bytesReceived,
19392
19406
  decoderImplementation: v.decoderImplementation
19393
19407
  };
19408
+ } else if (v.type === 'codec') {
19409
+ codecs.set(v.id, v);
19394
19410
  }
19395
19411
  });
19412
+ if (receiverStats && codecID !== '' && codecs.get(codecID)) {
19413
+ receiverStats.mimeType = codecs.get(codecID).mimeType;
19414
+ }
19396
19415
  return receiverStats;
19397
19416
  });
19398
19417
  }
@@ -20649,7 +20668,7 @@ class LocalParticipant extends Participant {
20649
20668
  */
20650
20669
  setupEngine(engine) {
20651
20670
  this.engine = engine;
20652
- this.engine.client.onRemoteMuteChanged = (trackSid, muted) => {
20671
+ this.engine.on(EngineEvent.RemoteMute, (trackSid, muted) => {
20653
20672
  const pub = this.tracks.get(trackSid);
20654
20673
  if (!pub || !pub.track) {
20655
20674
  return;
@@ -20659,10 +20678,8 @@ class LocalParticipant extends Participant {
20659
20678
  } else {
20660
20679
  pub.unmute();
20661
20680
  }
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);
20681
+ });
20682
+ 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
20683
  }
20667
20684
  /**
20668
20685
  * Sets and updates the metadata of the local participant.
@@ -22148,7 +22165,7 @@ class Room extends eventsExports.EventEmitter {
22148
22165
  this.localParticipant.activeDeviceMap.set('audioinput', unwrapConstraint(this.options.audioCaptureDefaults.deviceId));
22149
22166
  }
22150
22167
  if ((_a = this.options.audioOutput) === null || _a === void 0 ? void 0 : _a.deviceId) {
22151
- this.switchActiveDevice('audiooutput', unwrapConstraint(this.options.audioOutput.deviceId));
22168
+ this.switchActiveDevice('audiooutput', unwrapConstraint(this.options.audioOutput.deviceId)).catch(e => livekitLogger.warn("Could not set audio output: ".concat(e.message)));
22152
22169
  }
22153
22170
  if (this.options.e2ee) {
22154
22171
  this.setupE2EE();
@@ -22665,6 +22682,7 @@ class Room extends eventsExports.EventEmitter {
22665
22682
  });
22666
22683
  }
22667
22684
  createParticipant(id, info) {
22685
+ var _a;
22668
22686
  let participant;
22669
22687
  if (info) {
22670
22688
  participant = RemoteParticipant.fromParticipantInfo(this.engine.client, info);
@@ -22674,6 +22692,9 @@ class Room extends eventsExports.EventEmitter {
22674
22692
  if (this.options.expWebAudioMix) {
22675
22693
  participant.setAudioContext(this.audioContext);
22676
22694
  }
22695
+ if ((_a = this.options.audioOutput) === null || _a === void 0 ? void 0 : _a.deviceId) {
22696
+ participant.setAudioOutput(this.options.audioOutput).catch(e => livekitLogger.warn("Could not set audio output: ".concat(e.message)));
22697
+ }
22677
22698
  return participant;
22678
22699
  }
22679
22700
  getOrCreateParticipant(id, info) {