livekit-client 2.11.3 → 2.11.4
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.
- 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 +6 -10
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +27 -13
- 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/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +0 -2
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/utils.d.ts +1 -1
- package/dist/src/e2ee/utils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +2 -3
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/ts4.2/src/e2ee/types.d.ts +0 -2
- package/dist/ts4.2/src/e2ee/utils.d.ts +1 -1
- package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +2 -3
- package/package.json +1 -1
- package/src/e2ee/E2eeManager.ts +2 -11
- package/src/e2ee/constants.ts +0 -1
- package/src/e2ee/types.ts +0 -2
- package/src/e2ee/utils.ts +1 -2
- package/src/e2ee/worker/ParticipantKeyHandler.ts +2 -4
- package/src/e2ee/worker/e2ee.worker.ts +2 -2
- package/src/room/Room.ts +7 -2
@@ -10156,8 +10156,7 @@ const KEY_PROVIDER_DEFAULTS = {
|
|
10156
10156
|
ratchetSalt: SALT,
|
10157
10157
|
ratchetWindowSize: 8,
|
10158
10158
|
failureTolerance: DECRYPTION_FAILURE_TOLERANCE,
|
10159
|
-
keyringSize: 16
|
10160
|
-
allowKeyExtraction: false
|
10159
|
+
keyringSize: 16
|
10161
10160
|
};
|
10162
10161
|
|
10163
10162
|
var KeyProviderEvent;
|
@@ -10201,10 +10200,9 @@ function importKey(keyBytes_1) {
|
|
10201
10200
|
name: ENCRYPTION_ALGORITHM
|
10202
10201
|
};
|
10203
10202
|
let usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'encrypt';
|
10204
|
-
let extractable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
10205
10203
|
return function* () {
|
10206
10204
|
// https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey
|
10207
|
-
return crypto.subtle.importKey('raw', keyBytes, algorithm,
|
10205
|
+
return crypto.subtle.importKey('raw', keyBytes, algorithm, false, usage === 'derive' ? ['deriveBits', 'deriveKey'] : ['encrypt', 'decrypt']);
|
10208
10206
|
}();
|
10209
10207
|
});
|
10210
10208
|
}
|
@@ -11188,7 +11186,7 @@ function getOSVersion(ua) {
|
|
11188
11186
|
return ua.includes('mac os') ? getMatch(/\(.+?(\d+_\d+(:?_\d+)?)/, ua, 1).replace(/_/g, '.') : undefined;
|
11189
11187
|
}
|
11190
11188
|
|
11191
|
-
var version$1 = "2.11.
|
11189
|
+
var version$1 = "2.11.4";
|
11192
11190
|
|
11193
11191
|
const version = version$1;
|
11194
11192
|
const protocolVersion = 15;
|
@@ -12342,6 +12340,18 @@ function getNewAudioContext() {
|
|
12342
12340
|
return audioContext;
|
12343
12341
|
}
|
12344
12342
|
}
|
12343
|
+
/**
|
12344
|
+
* @internal
|
12345
|
+
*/
|
12346
|
+
function kindToSource(kind) {
|
12347
|
+
if (kind === 'audioinput') {
|
12348
|
+
return Track.Source.Microphone;
|
12349
|
+
} else if (kind === 'videoinput') {
|
12350
|
+
return Track.Source.Camera;
|
12351
|
+
} else {
|
12352
|
+
return Track.Source.Unknown;
|
12353
|
+
}
|
12354
|
+
}
|
12345
12355
|
/**
|
12346
12356
|
* @internal
|
12347
12357
|
*/
|
@@ -12636,9 +12646,9 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
12636
12646
|
room.localParticipant.on(ParticipantEvent.LocalTrackPublished, publication => __awaiter(this, void 0, void 0, function* () {
|
12637
12647
|
this.setupE2EESender(publication.track, publication.track.sender);
|
12638
12648
|
}));
|
12639
|
-
keyProvider.on(KeyProviderEvent.SetKey, keyInfo => this.postKey(keyInfo)).on(KeyProviderEvent.RatchetRequest, (participantId, keyIndex) => this.postRatchetRequest(participantId, keyIndex
|
12649
|
+
keyProvider.on(KeyProviderEvent.SetKey, keyInfo => this.postKey(keyInfo)).on(KeyProviderEvent.RatchetRequest, (participantId, keyIndex) => this.postRatchetRequest(participantId, keyIndex));
|
12640
12650
|
}
|
12641
|
-
postRatchetRequest(participantIdentity, keyIndex
|
12651
|
+
postRatchetRequest(participantIdentity, keyIndex) {
|
12642
12652
|
if (!this.worker) {
|
12643
12653
|
throw Error('could not ratchet key, worker is missing');
|
12644
12654
|
}
|
@@ -12646,8 +12656,7 @@ class E2EEManager extends eventsExports.EventEmitter {
|
|
12646
12656
|
kind: 'ratchetRequest',
|
12647
12657
|
data: {
|
12648
12658
|
participantIdentity: participantIdentity,
|
12649
|
-
keyIndex
|
12650
|
-
extractable
|
12659
|
+
keyIndex
|
12651
12660
|
}
|
12652
12661
|
};
|
12653
12662
|
this.worker.postMessage(msg);
|
@@ -22810,7 +22819,7 @@ class Room extends eventsExports.EventEmitter {
|
|
22810
22819
|
}
|
22811
22820
|
};
|
22812
22821
|
this.handleDeviceChange = () => __awaiter(this, void 0, void 0, function* () {
|
22813
|
-
var _a, _b;
|
22822
|
+
var _a, _b, _c;
|
22814
22823
|
const previousDevices = DeviceManager.getInstance().previousDevices;
|
22815
22824
|
// check for available devices, but don't request permissions in order to avoid prompts for kinds that haven't been used before
|
22816
22825
|
const availableDevices = yield DeviceManager.getInstance().getDevices(undefined, false);
|
@@ -22827,15 +22836,20 @@ class Room extends eventsExports.EventEmitter {
|
|
22827
22836
|
}
|
22828
22837
|
}
|
22829
22838
|
}
|
22830
|
-
// inputs are automatically handled via TrackEvent.Ended causing a TrackEvent.Restarted. Here we only need to worry about audiooutputs changing
|
22831
22839
|
const kinds = ['audiooutput', 'audioinput', 'videoinput'];
|
22832
22840
|
for (let kind of kinds) {
|
22841
|
+
const targetSource = kindToSource(kind);
|
22842
|
+
const targetPublication = this.localParticipant.getTrackPublication(targetSource);
|
22843
|
+
if (targetPublication && ((_a = targetPublication.track) === null || _a === void 0 ? void 0 : _a.isUserProvided)) {
|
22844
|
+
// if the track is user provided, we don't want to switch devices on behalf of the user
|
22845
|
+
continue;
|
22846
|
+
}
|
22833
22847
|
const devicesOfKind = availableDevices.filter(d => d.kind === kind);
|
22834
22848
|
const activeDevice = this.getActiveDevice(kind);
|
22835
|
-
if (activeDevice === ((
|
22849
|
+
if (activeDevice === ((_b = previousDevices.filter(info => info.kind === kind)[0]) === null || _b === void 0 ? void 0 : _b.deviceId)) {
|
22836
22850
|
// in Safari the first device is always the default, so we assume a user on the default device would like to switch to the default once it changes
|
22837
22851
|
// FF doesn't emit an event when the default device changes, so we perform the same best effort and switch to the new device once connected and if it's the first in the array
|
22838
|
-
if (devicesOfKind.length > 0 && ((
|
22852
|
+
if (devicesOfKind.length > 0 && ((_c = devicesOfKind[0]) === null || _c === void 0 ? void 0 : _c.deviceId) !== activeDevice) {
|
22839
22853
|
yield this.switchActiveDevice(kind, devicesOfKind[0].deviceId);
|
22840
22854
|
continue;
|
22841
22855
|
}
|