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.
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +10 -8
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +10400 -9929
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +2 -3
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +1 -0
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/logger.d.ts +2 -2
- package/dist/src/logger.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts +1 -1
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +4 -4
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/RegionUrlProvider.d.ts +1 -1
- package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +2 -3
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +5 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +1 -2
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +1 -2
- package/dist/src/room/track/Track.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +2 -3
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +1 -1
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +1 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -3
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +1 -0
- package/dist/ts4.2/src/index.d.ts +1 -1
- package/dist/ts4.2/src/logger.d.ts +2 -2
- package/dist/ts4.2/src/room/PCTransportManager.d.ts +1 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +5 -5
- package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +1 -1
- package/dist/ts4.2/src/room/Room.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/Participant.d.ts +2 -3
- package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +5 -1
- package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -2
- package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/Track.d.ts +1 -2
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +2 -3
- package/dist/ts4.2/src/room/track/utils.d.ts +1 -1
- package/dist/ts4.2/src/room/utils.d.ts +1 -1
- package/package.json +2 -2
- package/src/api/SignalClient.ts +19 -17
- package/src/connectionHelper/checks/websocket.ts +1 -1
- package/src/e2ee/E2eeManager.ts +1 -1
- package/src/e2ee/worker/FrameCryptor.ts +12 -6
- package/src/index.ts +1 -1
- package/src/logger.ts +21 -18
- package/src/room/PCTransportManager.ts +1 -1
- package/src/room/RTCEngine.ts +33 -31
- package/src/room/RegionUrlProvider.ts +1 -1
- package/src/room/Room.ts +36 -25
- package/src/room/participant/LocalParticipant.ts +4 -6
- package/src/room/participant/Participant.ts +4 -6
- package/src/room/participant/ParticipantTrackPermission.ts +1 -1
- package/src/room/participant/RemoteParticipant.ts +14 -2
- package/src/room/track/LocalAudioTrack.ts +5 -2
- package/src/room/track/LocalTrackPublication.ts +1 -1
- package/src/room/track/LocalVideoTrack.ts +11 -3
- package/src/room/track/RemoteTrackPublication.ts +7 -2
- package/src/room/track/Track.ts +6 -6
- package/src/room/track/TrackPublication.ts +7 -3
- package/src/room/track/facingMode.ts +2 -2
- package/src/room/track/utils.ts +19 -12
- package/src/room/utils.ts +4 -1
- package/dist/src/proto/livekit_models_pb.d.ts +0 -1405
- package/dist/src/proto/livekit_models_pb.d.ts.map +0 -1
- package/dist/src/proto/livekit_rtc_pb.d.ts +0 -1423
- package/dist/src/proto/livekit_rtc_pb.d.ts.map +0 -1
- package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +0 -1405
- package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +0 -1423
- package/src/proto/livekit_models_pb.ts +0 -2327
- 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
|
-
|
993
|
-
|
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
|
}
|