livekit-client 2.0.4 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/livekit-client.e2ee.worker.js +1 -1
  2. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  3. package/dist/livekit-client.e2ee.worker.mjs +10 -8
  4. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  5. package/dist/livekit-client.esm.mjs +10400 -9929
  6. package/dist/livekit-client.esm.mjs.map +1 -1
  7. package/dist/livekit-client.umd.js +1 -1
  8. package/dist/livekit-client.umd.js.map +1 -1
  9. package/dist/src/api/SignalClient.d.ts +2 -3
  10. package/dist/src/api/SignalClient.d.ts.map +1 -1
  11. package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
  12. package/dist/src/e2ee/worker/FrameCryptor.d.ts +1 -0
  13. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  14. package/dist/src/index.d.ts +1 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/logger.d.ts +2 -2
  17. package/dist/src/logger.d.ts.map +1 -1
  18. package/dist/src/room/PCTransportManager.d.ts +1 -1
  19. package/dist/src/room/PCTransportManager.d.ts.map +1 -1
  20. package/dist/src/room/RTCEngine.d.ts +4 -4
  21. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  22. package/dist/src/room/RegionUrlProvider.d.ts +1 -1
  23. package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
  24. package/dist/src/room/Room.d.ts +1 -1
  25. package/dist/src/room/Room.d.ts.map +1 -1
  26. package/dist/src/room/participant/LocalParticipant.d.ts +1 -1
  27. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  28. package/dist/src/room/participant/Participant.d.ts +2 -3
  29. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  30. package/dist/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
  31. package/dist/src/room/participant/ParticipantTrackPermission.d.ts.map +1 -1
  32. package/dist/src/room/participant/RemoteParticipant.d.ts +5 -1
  33. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  34. package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
  35. package/dist/src/room/track/LocalTrackPublication.d.ts +1 -1
  36. package/dist/src/room/track/LocalTrackPublication.d.ts.map +1 -1
  37. package/dist/src/room/track/LocalVideoTrack.d.ts +1 -2
  38. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  39. package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
  40. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  41. package/dist/src/room/track/Track.d.ts +1 -2
  42. package/dist/src/room/track/Track.d.ts.map +1 -1
  43. package/dist/src/room/track/TrackPublication.d.ts +2 -3
  44. package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
  45. package/dist/src/room/track/utils.d.ts +1 -1
  46. package/dist/src/room/track/utils.d.ts.map +1 -1
  47. package/dist/src/room/utils.d.ts +1 -1
  48. package/dist/src/room/utils.d.ts.map +1 -1
  49. package/dist/ts4.2/src/api/SignalClient.d.ts +2 -3
  50. package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +1 -0
  51. package/dist/ts4.2/src/index.d.ts +1 -1
  52. package/dist/ts4.2/src/logger.d.ts +2 -2
  53. package/dist/ts4.2/src/room/PCTransportManager.d.ts +1 -1
  54. package/dist/ts4.2/src/room/RTCEngine.d.ts +5 -5
  55. package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +1 -1
  56. package/dist/ts4.2/src/room/Room.d.ts +1 -1
  57. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +1 -1
  58. package/dist/ts4.2/src/room/participant/Participant.d.ts +2 -3
  59. package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
  60. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +5 -1
  61. package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +1 -1
  62. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -2
  63. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
  64. package/dist/ts4.2/src/room/track/Track.d.ts +1 -2
  65. package/dist/ts4.2/src/room/track/TrackPublication.d.ts +2 -3
  66. package/dist/ts4.2/src/room/track/utils.d.ts +1 -1
  67. package/dist/ts4.2/src/room/utils.d.ts +1 -1
  68. package/package.json +2 -2
  69. package/src/api/SignalClient.ts +19 -17
  70. package/src/connectionHelper/checks/websocket.ts +1 -1
  71. package/src/e2ee/E2eeManager.ts +1 -1
  72. package/src/e2ee/worker/FrameCryptor.ts +12 -6
  73. package/src/index.ts +1 -1
  74. package/src/logger.ts +21 -18
  75. package/src/room/PCTransportManager.ts +1 -1
  76. package/src/room/RTCEngine.ts +33 -31
  77. package/src/room/RegionUrlProvider.ts +1 -1
  78. package/src/room/Room.ts +36 -25
  79. package/src/room/participant/LocalParticipant.ts +4 -6
  80. package/src/room/participant/Participant.ts +4 -6
  81. package/src/room/participant/ParticipantTrackPermission.ts +1 -1
  82. package/src/room/participant/RemoteParticipant.ts +14 -2
  83. package/src/room/track/LocalAudioTrack.ts +5 -2
  84. package/src/room/track/LocalTrackPublication.ts +1 -1
  85. package/src/room/track/LocalVideoTrack.ts +11 -3
  86. package/src/room/track/RemoteTrackPublication.ts +7 -2
  87. package/src/room/track/Track.ts +6 -6
  88. package/src/room/track/TrackPublication.ts +7 -3
  89. package/src/room/track/facingMode.ts +2 -2
  90. package/src/room/track/utils.ts +19 -12
  91. package/src/room/utils.ts +4 -1
  92. package/dist/src/proto/livekit_models_pb.d.ts +0 -1405
  93. package/dist/src/proto/livekit_models_pb.d.ts.map +0 -1
  94. package/dist/src/proto/livekit_rtc_pb.d.ts +0 -1423
  95. package/dist/src/proto/livekit_rtc_pb.d.ts.map +0 -1
  96. package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +0 -1405
  97. package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +0 -1423
  98. package/src/proto/livekit_models_pb.ts +0 -2327
  99. package/src/proto/livekit_rtc_pb.ts +0 -2411
@@ -322,6 +322,7 @@ var LoggerNames;
322
322
  LoggerNames["E2EE"] = "lk-e2ee";
323
323
  })(LoggerNames || (LoggerNames = {}));
324
324
  let livekitLogger = loglevelExports.getLogger('livekit');
325
+ Object.values(LoggerNames).map(name => loglevelExports.getLogger(name));
325
326
  livekitLogger.setDefaultLevel(LogLevel.info);
326
327
  const workerLogger = loglevelExports.getLogger('lk-e2ee');
327
328
 
@@ -989,8 +990,8 @@ class FrameCryptor extends BaseFrameCryptor {
989
990
  }
990
991
  get logContext() {
991
992
  return {
992
- identity: this.participantIdentity,
993
- trackId: this.trackId,
993
+ participant: this.participantIdentity,
994
+ mediaTrackId: this.trackId,
994
995
  fallbackCodec: this.videoCodec
995
996
  };
996
997
  }
@@ -1105,7 +1106,6 @@ class FrameCryptor extends BaseFrameCryptor {
1105
1106
  if (encryptionKey) {
1106
1107
  const iv = this.makeIV((_a = encodedFrame.getMetadata().synchronizationSource) !== null && _a !== void 0 ? _a : -1, encodedFrame.timestamp);
1107
1108
  let frameInfo = this.getUnencryptedBytes(encodedFrame);
1108
- workerLogger.debug('frameInfo for encoded frame', Object.assign(Object.assign({}, frameInfo), this.logContext));
1109
1109
  // Thіs is not encrypted and contains the VP8 payload descriptor or the Opus TOC byte.
1110
1110
  const frameHeader = new Uint8Array(encodedFrame.data, 0, frameInfo.unencryptedBytes);
1111
1111
  // Frame trailer contains the R|IV_LENGTH and key index
@@ -1182,7 +1182,6 @@ class FrameCryptor extends BaseFrameCryptor {
1182
1182
  const decodedFrame = yield this.decryptFrame(encodedFrame, keyIndex);
1183
1183
  this.keys.decryptionSuccess();
1184
1184
  if (decodedFrame) {
1185
- workerLogger.debug('enqueue decrypted frame', this.logContext);
1186
1185
  return controller.enqueue(decodedFrame);
1187
1186
  }
1188
1187
  } catch (error) {
@@ -1220,7 +1219,6 @@ class FrameCryptor extends BaseFrameCryptor {
1220
1219
  throw new TypeError("no encryption key found for decryption of ".concat(this.participantIdentity));
1221
1220
  }
1222
1221
  let frameInfo = this.getUnencryptedBytes(encodedFrame);
1223
- workerLogger.debug('frameInfo for decoded frame', Object.assign(Object.assign({}, frameInfo), this.logContext));
1224
1222
  // Construct frame trailer. Similar to the frame header described in
1225
1223
  // https://tools.ietf.org/html/draft-omara-sframe-00#section-4.2
1226
1224
  // but we put it at the end.
@@ -1337,6 +1335,13 @@ class FrameCryptor extends BaseFrameCryptor {
1337
1335
  };
1338
1336
  if (isVideoFrame(frame)) {
1339
1337
  let detectedCodec = (_a = this.getVideoCodec(frame)) !== null && _a !== void 0 ? _a : this.videoCodec;
1338
+ if (detectedCodec !== this.detectedCodec) {
1339
+ workerLogger.debug('detected different codec', Object.assign({
1340
+ detectedCodec,
1341
+ oldCodec: this.detectedCodec
1342
+ }, this.logContext));
1343
+ this.detectedCodec = detectedCodec;
1344
+ }
1340
1345
  if (detectedCodec === 'av1' || detectedCodec === 'vp9') {
1341
1346
  throw new Error("".concat(detectedCodec, " is not yet supported for end to end encryption"));
1342
1347
  }
@@ -1383,9 +1388,6 @@ class FrameCryptor extends BaseFrameCryptor {
1383
1388
  // @ts-expect-error payloadType is not yet part of the typescript definition and currently not supported in Safari
1384
1389
  const payloadType = frame.getMetadata().payloadType;
1385
1390
  const codec = payloadType ? this.rtpMap.get(payloadType) : undefined;
1386
- workerLogger.debug('reading codec from frame', Object.assign({
1387
- codec
1388
- }, this.logContext));
1389
1391
  return codec;
1390
1392
  }
1391
1393
  }