livekit-client 2.5.5 → 2.5.7
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 +5443 -736
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +2129 -1954
- 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/worker/FrameCryptor.d.ts +2 -2
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +2 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +2 -2
- package/dist/src/room/participant/Participant.d.ts +1 -1
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +1 -1
- package/dist/src/room/track/Track.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/src/test/mocks.d.ts +1 -1
- package/dist/src/test/mocks.d.ts.map +1 -1
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +2 -2
- package/dist/ts4.2/src/index.d.ts +2 -2
- package/dist/ts4.2/src/room/Room.d.ts +2 -1
- package/dist/ts4.2/src/room/events.d.ts +2 -2
- package/dist/ts4.2/src/room/participant/Participant.d.ts +1 -1
- package/dist/ts4.2/src/room/track/Track.d.ts +1 -1
- package/dist/ts4.2/src/room/utils.d.ts +1 -1
- package/dist/ts4.2/src/test/mocks.d.ts +1 -1
- package/package.json +10 -11
- package/src/e2ee/E2eeManager.ts +8 -8
- package/src/e2ee/worker/FrameCryptor.test.ts +249 -2
- package/src/e2ee/worker/FrameCryptor.ts +13 -7
- package/src/e2ee/worker/ParticipantKeyHandler.test.ts +122 -0
- package/src/e2ee/worker/ParticipantKeyHandler.ts +1 -1
- package/src/e2ee/worker/e2ee.worker.ts +82 -78
- package/src/index.ts +2 -0
- package/src/room/Room.ts +16 -10
- package/src/room/events.ts +2 -2
- package/src/room/participant/Participant.ts +3 -2
- package/src/room/track/Track.ts +1 -1
- package/src/room/track/utils.ts +1 -1
- package/src/room/utils.ts +1 -1
- package/src/test/mocks.ts +1 -1
package/src/room/Room.ts
CHANGED
@@ -135,6 +135,8 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
135
135
|
/** reflects the sender encryption status of the local participant */
|
136
136
|
isE2EEEnabled: boolean = false;
|
137
137
|
|
138
|
+
serverInfo?: Partial<ServerInfo>;
|
139
|
+
|
138
140
|
private roomInfo?: RoomModel;
|
139
141
|
|
140
142
|
private sidToIdentity: Map<string, string>;
|
@@ -609,6 +611,7 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
609
611
|
if (!serverInfo) {
|
610
612
|
serverInfo = { version: joinResponse.serverVersion, region: joinResponse.serverRegion };
|
611
613
|
}
|
614
|
+
this.serverInfo = serverInfo;
|
612
615
|
|
613
616
|
this.log.debug(
|
614
617
|
`connected to Livekit Server ${Object.entries(serverInfo)
|
@@ -621,11 +624,11 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
621
624
|
},
|
622
625
|
);
|
623
626
|
|
624
|
-
if (!
|
627
|
+
if (!serverInfo.version) {
|
625
628
|
throw new UnsupportedServer('unknown server version');
|
626
629
|
}
|
627
630
|
|
628
|
-
if (
|
631
|
+
if (serverInfo.version === '0.15.1' && this.options.dynacast) {
|
629
632
|
this.log.debug('disabling dynacast due to server version', this.logContext);
|
630
633
|
// dynacast has a bug in 0.15.1, so we cannot use it then
|
631
634
|
roomOptions.dynacast = false;
|
@@ -1490,14 +1493,17 @@ class Room extends (EventEmitter as new () => TypedEmitter<RoomEventCallbacks>)
|
|
1490
1493
|
if (!pub || !pub.track) {
|
1491
1494
|
return;
|
1492
1495
|
}
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1496
|
+
const newStreamState = Track.streamStateFromProto(streamState.state);
|
1497
|
+
if (newStreamState !== pub.track.streamState) {
|
1498
|
+
pub.track.streamState = newStreamState;
|
1499
|
+
participant.emit(ParticipantEvent.TrackStreamStateChanged, pub, pub.track.streamState);
|
1500
|
+
this.emitWhenConnected(
|
1501
|
+
RoomEvent.TrackStreamStateChanged,
|
1502
|
+
pub,
|
1503
|
+
pub.track.streamState,
|
1504
|
+
participant,
|
1505
|
+
);
|
1506
|
+
}
|
1501
1507
|
});
|
1502
1508
|
};
|
1503
1509
|
|
package/src/room/events.ts
CHANGED
@@ -294,7 +294,7 @@ export enum RoomEvent {
|
|
294
294
|
MediaDevicesError = 'mediaDevicesError',
|
295
295
|
|
296
296
|
/**
|
297
|
-
* A participant's permission has changed.
|
297
|
+
* A participant's permission has changed.
|
298
298
|
* args: (prevPermissions: [[ParticipantPermission]], participant: [[Participant]])
|
299
299
|
*/
|
300
300
|
ParticipantPermissionsChanged = 'participantPermissionsChanged',
|
@@ -502,7 +502,7 @@ export enum ParticipantEvent {
|
|
502
502
|
AudioStreamAcquired = 'audioStreamAcquired',
|
503
503
|
|
504
504
|
/**
|
505
|
-
* A participant's permission has changed.
|
505
|
+
* A participant's permission has changed.
|
506
506
|
* args: (prevPermissions: [[ParticipantPermission]])
|
507
507
|
*/
|
508
508
|
ParticipantPermissionsChanged = 'participantPermissionsChanged',
|
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
} from '@livekit/protocol';
|
10
10
|
import { EventEmitter } from 'events';
|
11
11
|
import type TypedEmitter from 'typed-emitter';
|
12
|
-
import log, { LoggerNames, StructuredLogger, getLogger } from '../../logger';
|
12
|
+
import log, { LoggerNames, type StructuredLogger, getLogger } from '../../logger';
|
13
13
|
import { ParticipantEvent, TrackEvent } from '../events';
|
14
14
|
import LocalAudioTrack from '../track/LocalAudioTrack';
|
15
15
|
import type LocalTrackPublication from '../track/LocalTrackPublication';
|
@@ -279,7 +279,8 @@ export default class Participant extends (EventEmitter as new () => TypedEmitter
|
|
279
279
|
permissions.canPublishSources.length !== this.permissions.canPublishSources.length ||
|
280
280
|
permissions.canPublishSources.some(
|
281
281
|
(value, index) => value !== this.permissions?.canPublishSources[index],
|
282
|
-
)
|
282
|
+
) ||
|
283
|
+
permissions.canSubscribeMetrics !== this.permissions?.canSubscribeMetrics;
|
283
284
|
this.permissions = permissions;
|
284
285
|
|
285
286
|
if (changed) {
|
package/src/room/track/Track.ts
CHANGED
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
import { EventEmitter } from 'events';
|
9
9
|
import type TypedEventEmitter from 'typed-emitter';
|
10
10
|
import type { SignalClient } from '../../api/SignalClient';
|
11
|
-
import log, { LoggerNames, StructuredLogger, getLogger } from '../../logger';
|
11
|
+
import log, { LoggerNames, type StructuredLogger, getLogger } from '../../logger';
|
12
12
|
import { TrackEvent } from '../events';
|
13
13
|
import type { LoggerOptions } from '../types';
|
14
14
|
import { isFireFox, isSafari, isWeb } from '../utils';
|
package/src/room/track/utils.ts
CHANGED
package/src/room/utils.ts
CHANGED
@@ -9,7 +9,7 @@ import { protocolVersion, version } from '../version';
|
|
9
9
|
import CriticalTimers from './timers';
|
10
10
|
import type LocalAudioTrack from './track/LocalAudioTrack';
|
11
11
|
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
12
|
-
import { VideoCodec, videoCodecs } from './track/options';
|
12
|
+
import { type VideoCodec, videoCodecs } from './track/options';
|
13
13
|
import { getNewAudioContext } from './track/utils';
|
14
14
|
import type { ChatMessage, LiveKitReactNativeInfo, TranscriptionSegment } from './types';
|
15
15
|
|
package/src/test/mocks.ts
CHANGED