livekit-client 2.18.9 → 2.19.0
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 +5609 -644
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +3553 -2813
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.pt.worker.js +2 -0
- package/dist/livekit-client.pt.worker.js.map +1 -0
- package/dist/livekit-client.pt.worker.mjs +5834 -0
- package/dist/livekit-client.pt.worker.mjs.map +1 -0
- 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 -1
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +8 -7
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +35 -8
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/utils.d.ts +5 -5
- package/dist/src/e2ee/utils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/DataCryptor.d.ts +5 -5
- package/dist/src/e2ee/worker/DataCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +21 -4
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/naluUtils.d.ts +1 -1
- package/dist/src/e2ee/worker/naluUtils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/sifPayload.d.ts +7 -7
- package/dist/src/e2ee/worker/sifPayload.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/options.d.ts +7 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/packetTrailer/PacketTrailerManager.d.ts +49 -0
- package/dist/src/packetTrailer/PacketTrailerManager.d.ts.map +1 -0
- package/dist/src/packetTrailer/packetTrailer.d.ts +32 -0
- package/dist/src/packetTrailer/packetTrailer.d.ts.map +1 -0
- package/dist/src/packetTrailer/types.d.ts +57 -0
- package/dist/src/packetTrailer/types.d.ts.map +1 -0
- package/dist/src/packetTrailer/utils.d.ts +9 -0
- package/dist/src/packetTrailer/utils.d.ts.map +1 -0
- package/dist/src/packetTrailer/worker/packetTrailer.worker.d.ts +2 -0
- package/dist/src/packetTrailer/worker/packetTrailer.worker.d.ts.map +1 -0
- package/dist/src/room/RTCEngine.d.ts +2 -4
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +7 -3
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/data-track/RemoteDataTrack.d.ts +5 -1
- package/dist/src/room/data-track/RemoteDataTrack.d.ts.map +1 -1
- package/dist/src/room/data-track/depacketizer.d.ts +12 -4
- package/dist/src/room/data-track/depacketizer.d.ts.map +1 -1
- package/dist/src/room/data-track/frame.d.ts +3 -3
- package/dist/src/room/data-track/frame.d.ts.map +1 -1
- package/dist/src/room/data-track/incoming/IncomingDataTrackManager.d.ts +3 -1
- package/dist/src/room/data-track/incoming/IncomingDataTrackManager.d.ts.map +1 -1
- package/dist/src/room/data-track/incoming/pipeline.d.ts +4 -1
- package/dist/src/room/data-track/incoming/pipeline.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/types.d.ts +2 -2
- package/dist/src/room/data-track/outgoing/types.d.ts.map +1 -1
- package/dist/src/room/data-track/packet/extensions.d.ts +4 -4
- package/dist/src/room/data-track/packet/extensions.d.ts.map +1 -1
- package/dist/src/room/data-track/packet/index.d.ts +5 -5
- package/dist/src/room/data-track/packet/index.d.ts.map +1 -1
- package/dist/src/room/data-track/packet/serializable.d.ts +1 -1
- package/dist/src/room/data-track/packet/serializable.d.ts.map +1 -1
- package/dist/src/room/data-track/types.d.ts +7 -0
- package/dist/src/room/data-track/types.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +2 -2
- package/dist/src/room/participant/LocalParticipant.d.ts +8 -14
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- 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/participant/RemoteParticipant.d.ts +5 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/rpc/client/RpcClientManager.d.ts +39 -0
- package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -0
- package/dist/src/room/rpc/client/events.d.ts +8 -0
- package/dist/src/room/rpc/client/events.d.ts.map +1 -0
- package/dist/src/room/rpc/index.d.ts +6 -0
- package/dist/src/room/rpc/index.d.ts.map +1 -0
- package/dist/src/room/rpc/server/RpcServerManager.d.ts +44 -0
- package/dist/src/room/rpc/server/RpcServerManager.d.ts.map +1 -0
- package/dist/src/room/rpc/server/events.d.ts +8 -0
- package/dist/src/room/rpc/server/events.d.ts.map +1 -0
- package/dist/src/room/{rpc.d.ts → rpc/utils.d.ts} +34 -4
- package/dist/src/room/rpc/utils.d.ts.map +1 -0
- package/dist/src/room/track/PacketTrailerExtractor.d.ts +19 -0
- package/dist/src/room/track/PacketTrailerExtractor.d.ts.map +1 -0
- package/dist/src/room/track/RemoteVideoTrack.d.ts +16 -0
- package/dist/src/room/track/RemoteVideoTrack.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/track/create.d.ts.map +1 -1
- package/dist/src/room/track/options.d.ts +10 -0
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +4 -3
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/MockMediaStreamTrack.d.ts.map +1 -1
- package/dist/src/utils/dataPacketBuffer.d.ts +1 -1
- package/dist/src/utils/dataPacketBuffer.d.ts.map +1 -1
- package/dist/src/version.d.ts +9 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/ts4.2/api/SignalClient.d.ts +2 -1
- package/dist/ts4.2/e2ee/E2eeManager.d.ts +8 -7
- package/dist/ts4.2/e2ee/types.d.ts +35 -8
- package/dist/ts4.2/e2ee/utils.d.ts +5 -5
- package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +5 -5
- package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +21 -4
- package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +1 -1
- package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +7 -7
- package/dist/ts4.2/index.d.ts +5 -1
- package/dist/ts4.2/options.d.ts +7 -0
- package/dist/ts4.2/packetTrailer/PacketTrailerManager.d.ts +49 -0
- package/dist/ts4.2/packetTrailer/packetTrailer.d.ts +32 -0
- package/dist/ts4.2/packetTrailer/types.d.ts +57 -0
- package/dist/ts4.2/packetTrailer/utils.d.ts +9 -0
- package/dist/ts4.2/packetTrailer/worker/packetTrailer.worker.d.ts +2 -0
- package/dist/ts4.2/room/RTCEngine.d.ts +2 -4
- package/dist/ts4.2/room/Room.d.ts +7 -3
- package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +5 -1
- package/dist/ts4.2/room/data-track/depacketizer.d.ts +12 -4
- package/dist/ts4.2/room/data-track/frame.d.ts +3 -3
- package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +3 -1
- package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +4 -1
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +2 -2
- package/dist/ts4.2/room/data-track/packet/extensions.d.ts +4 -4
- package/dist/ts4.2/room/data-track/packet/index.d.ts +5 -5
- package/dist/ts4.2/room/data-track/packet/serializable.d.ts +1 -1
- package/dist/ts4.2/room/data-track/types.d.ts +7 -0
- package/dist/ts4.2/room/events.d.ts +2 -2
- package/dist/ts4.2/room/participant/LocalParticipant.d.ts +8 -14
- package/dist/ts4.2/room/participant/Participant.d.ts +1 -1
- package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +5 -1
- package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -0
- package/dist/ts4.2/room/rpc/client/events.d.ts +8 -0
- package/dist/ts4.2/room/rpc/index.d.ts +7 -0
- package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -0
- package/dist/ts4.2/room/rpc/server/events.d.ts +8 -0
- package/dist/ts4.2/room/{rpc.d.ts → rpc/utils.d.ts} +34 -4
- package/dist/ts4.2/room/track/PacketTrailerExtractor.d.ts +19 -0
- package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +16 -0
- package/dist/ts4.2/room/track/Track.d.ts +1 -1
- package/dist/ts4.2/room/track/options.d.ts +10 -0
- package/dist/ts4.2/room/utils.d.ts +4 -3
- package/dist/ts4.2/utils/dataPacketBuffer.d.ts +1 -1
- package/dist/ts4.2/version.d.ts +9 -1
- package/package.json +24 -16
- package/src/api/SignalClient.test.ts +102 -10
- package/src/api/SignalClient.ts +4 -2
- package/src/api/WebSocketStream.test.ts +0 -1
- package/src/e2ee/E2eeManager.ts +82 -30
- package/src/e2ee/types.ts +37 -8
- package/src/e2ee/utils.ts +7 -6
- package/src/e2ee/worker/DataCryptor.ts +6 -6
- package/src/e2ee/worker/FrameCryptor.test.ts +177 -4
- package/src/e2ee/worker/FrameCryptor.ts +94 -14
- package/src/e2ee/worker/ParticipantKeyHandler.test.ts +4 -4
- package/src/e2ee/worker/e2ee.worker.ts +13 -5
- package/src/e2ee/worker/naluUtils.ts +4 -4
- package/src/e2ee/worker/sifPayload.ts +10 -8
- package/src/index.ts +7 -0
- package/src/options.ts +8 -0
- package/src/packetTrailer/PacketTrailerManager.test.ts +172 -0
- package/src/packetTrailer/PacketTrailerManager.ts +250 -0
- package/src/packetTrailer/packetTrailer.test.ts +174 -0
- package/src/packetTrailer/packetTrailer.ts +276 -0
- package/src/packetTrailer/types.ts +75 -0
- package/src/packetTrailer/utils.test.ts +105 -0
- package/src/packetTrailer/utils.ts +50 -0
- package/src/packetTrailer/worker/packetTrailer.worker.ts +155 -0
- package/src/packetTrailer/worker/tsconfig.json +14 -0
- package/src/room/BackOffStrategy.test.ts +1 -1
- package/src/room/RTCEngine.test.ts +219 -0
- package/src/room/RTCEngine.ts +86 -46
- package/src/room/Room.test.ts +62 -1
- package/src/room/Room.ts +111 -86
- package/src/room/data-track/RemoteDataTrack.ts +8 -1
- package/src/room/data-track/depacketizer.test.ts +433 -1
- package/src/room/data-track/depacketizer.ts +79 -61
- package/src/room/data-track/frame.ts +2 -2
- package/src/room/data-track/incoming/IncomingDataTrackManager.test.ts +194 -0
- package/src/room/data-track/incoming/IncomingDataTrackManager.ts +21 -1
- package/src/room/data-track/incoming/pipeline.ts +13 -2
- package/src/room/data-track/outgoing/types.ts +3 -2
- package/src/room/data-track/packet/extensions.ts +2 -2
- package/src/room/data-track/packet/index.ts +6 -6
- package/src/room/data-track/packet/serializable.ts +1 -1
- package/src/room/data-track/types.ts +8 -0
- package/src/room/events.ts +2 -2
- package/src/room/participant/LocalParticipant.test.ts +81 -0
- package/src/room/participant/LocalParticipant.ts +64 -187
- package/src/room/participant/Participant.ts +1 -1
- package/src/room/participant/RemoteParticipant.ts +9 -0
- package/src/room/participant/publishUtils.ts +1 -1
- package/src/room/rpc/client/RpcClientManager.test.ts +430 -0
- package/src/room/rpc/client/RpcClientManager.ts +269 -0
- package/src/room/rpc/client/events.ts +9 -0
- package/src/room/rpc/index.ts +14 -0
- package/src/room/rpc/server/RpcServerManager.test.ts +471 -0
- package/src/room/rpc/server/RpcServerManager.ts +293 -0
- package/src/room/rpc/server/events.ts +9 -0
- package/src/room/{rpc.ts → rpc/utils.ts} +49 -8
- package/src/room/track/PacketTrailerExtractor.ts +43 -0
- package/src/room/track/RemoteVideoTrack.ts +23 -2
- package/src/room/track/Track.ts +1 -1
- package/src/room/track/create.ts +0 -4
- package/src/room/track/options.ts +11 -0
- package/src/room/track/record.ts +1 -1
- package/src/room/track/utils.ts +4 -1
- package/src/room/utils.test.ts +14 -1
- package/src/room/utils.ts +19 -4
- package/src/test/MockMediaStreamTrack.ts +0 -1
- package/src/type-polyfills/non-shared-typed-arrays.d.ts +6 -0
- package/src/utils/dataPacketBuffer.ts +1 -1
- package/src/version.ts +11 -1
- package/dist/src/room/rpc.d.ts.map +0 -1
- package/src/room/rpc.test.ts +0 -301
|
@@ -68,6 +68,7 @@ declare class Room extends Room_base {
|
|
|
68
68
|
private connectFuture?;
|
|
69
69
|
private disconnectLock;
|
|
70
70
|
private e2eeManager;
|
|
71
|
+
private packetTrailerManager;
|
|
71
72
|
private e2eeStateMutex;
|
|
72
73
|
private connectionReconcileInterval?;
|
|
73
74
|
private regionUrlProvider?;
|
|
@@ -84,7 +85,8 @@ declare class Room extends Room_base {
|
|
|
84
85
|
private outgoingDataStreamManager;
|
|
85
86
|
private incomingDataTrackManager;
|
|
86
87
|
private outgoingDataTrackManager;
|
|
87
|
-
private
|
|
88
|
+
private rpcClientManager;
|
|
89
|
+
private rpcServerManager;
|
|
88
90
|
get hasE2EESetup(): boolean;
|
|
89
91
|
/**
|
|
90
92
|
* Creates a new Room, the primary construct for a LiveKit session.
|
|
@@ -133,6 +135,7 @@ declare class Room extends Room_base {
|
|
|
133
135
|
*/
|
|
134
136
|
setE2EEEnabled(enabled: boolean): Promise<void>;
|
|
135
137
|
private setupE2EE;
|
|
138
|
+
private setupPacketTrailer;
|
|
136
139
|
private get logContext();
|
|
137
140
|
/**
|
|
138
141
|
* if the current room has a participant with `recorder: true` in its JWT grant
|
|
@@ -242,7 +245,6 @@ declare class Room extends Room_base {
|
|
|
242
245
|
private handleChatMessage;
|
|
243
246
|
private handleMetrics;
|
|
244
247
|
private handleDataStream;
|
|
245
|
-
private handleIncomingRpcRequest;
|
|
246
248
|
bufferedSegments: Map<string, TranscriptionSegmentModel>;
|
|
247
249
|
private handleAudioPlaybackStarted;
|
|
248
250
|
private handleAudioPlaybackFailed;
|
|
@@ -265,6 +267,8 @@ declare class Room extends Room_base {
|
|
|
265
267
|
*/
|
|
266
268
|
private updateSubscriptions;
|
|
267
269
|
private getRemoteParticipantBySid;
|
|
270
|
+
private getRemoteParticipantClientProtocol;
|
|
271
|
+
private registerRpcDataStreamHandler;
|
|
268
272
|
private registerConnectionReconcile;
|
|
269
273
|
private clearConnectionReconcile;
|
|
270
274
|
private setAndEmitConnectionState;
|
|
@@ -319,7 +323,7 @@ export type RoomEventCallbacks = {
|
|
|
319
323
|
participantAttributesChanged: (changedAttributes: Record<string, string>, participant: RemoteParticipant | LocalParticipant) => void;
|
|
320
324
|
activeSpeakersChanged: (speakers: Array<Participant>) => void;
|
|
321
325
|
roomMetadataChanged: (metadata: string) => void;
|
|
322
|
-
dataReceived: (payload:
|
|
326
|
+
dataReceived: (payload: NonSharedUint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string, encryptionType?: Encryption_Type) => void;
|
|
323
327
|
sipDTMFReceived: (dtmf: SipDTMF, participant?: RemoteParticipant) => void;
|
|
324
328
|
transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void;
|
|
325
329
|
connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void;
|
|
@@ -2,7 +2,7 @@ import type Participant from '../participant/Participant';
|
|
|
2
2
|
import type { DataTrackFrame } from './frame';
|
|
3
3
|
import type IncomingDataTrackManager from './incoming/IncomingDataTrackManager';
|
|
4
4
|
import type { IDataTrack, IRemoteTrack } from './track-interfaces';
|
|
5
|
-
import type { DataTrackInfo } from './types';
|
|
5
|
+
import type { DataTrackInfo, RemoteDataTrackPipelineOptions } from './types';
|
|
6
6
|
type RemoteDataTrackOptions = {
|
|
7
7
|
publisherIdentity: Participant['identity'];
|
|
8
8
|
};
|
|
@@ -41,6 +41,10 @@ export default class RemoteDataTrack implements IRemoteTrack, IDataTrack {
|
|
|
41
41
|
* the initial subscription is established.
|
|
42
42
|
*/
|
|
43
43
|
subscribe(options?: DataTrackSubscribeOptions): ReadableStream<DataTrackFrame>;
|
|
44
|
+
/** Configure how incoming frames for this track are processed before they are handed out to
|
|
45
|
+
* subscribers (the "pipeline"). These options apply to all current and future subscriptions
|
|
46
|
+
* of this track, and may be set at any time. */
|
|
47
|
+
setPipelineOptions(options: RemoteDataTrackPipelineOptions): void;
|
|
44
48
|
}
|
|
45
49
|
export {};
|
|
46
50
|
//# sourceMappingURL=RemoteDataTrack.d.ts.map
|
|
@@ -24,14 +24,21 @@ export declare enum DataTrackDepacketizerDropReason {
|
|
|
24
24
|
Incomplete = 3
|
|
25
25
|
}
|
|
26
26
|
type PushOptions = {
|
|
27
|
-
/** If true, throws
|
|
28
|
-
*
|
|
29
|
-
|
|
27
|
+
/** If true, throws `DataTrackDepacketizerDropError.interrupted` instead of logging a warning
|
|
28
|
+
* when a new frame arrives while the partials map is at capacity. */
|
|
29
|
+
throwOnInterruption: boolean;
|
|
30
|
+
/** Maximum number of partial frames the depacketizer will track concurrently. When a new
|
|
31
|
+
* frame arrives while the partials map is at capacity, the oldest partial is evicted (or
|
|
32
|
+
* `DataTrackDepacketizerDropError.interrupted` is thrown when `throwOnInterruption` is set).
|
|
33
|
+
* Defaults to 1. */
|
|
34
|
+
maxPartialFrames?: number;
|
|
30
35
|
};
|
|
31
36
|
export default class DataTrackDepacketizer {
|
|
32
37
|
/** Maximum number of packets to buffer per frame before dropping. */
|
|
33
38
|
static MAX_BUFFER_PACKETS: number;
|
|
34
|
-
|
|
39
|
+
/** Partial frames currently being assembled, keyed by frame number. `Map` preserves insertion
|
|
40
|
+
* order, so the oldest entry is the first key. */
|
|
41
|
+
private partials;
|
|
35
42
|
/** Should be repeatedly called with received {@link DataTrackPacket}s - intermediate calls
|
|
36
43
|
* aggregate the packet's state internally, and return null.
|
|
37
44
|
*
|
|
@@ -39,6 +46,7 @@ export default class DataTrackDepacketizer {
|
|
|
39
46
|
* is returned.*/
|
|
40
47
|
push(packet: DataTrackPacket, options?: PushOptions): Throws<DataTrackFrameInternal | null, DataTrackDepacketizerDropError>;
|
|
41
48
|
reset(): void;
|
|
49
|
+
private peekOldestPartialFrameNumber;
|
|
42
50
|
private frameFromSingle;
|
|
43
51
|
/** Begin assembling a new packet. */
|
|
44
52
|
private beginPartial;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { DataTrackExtensions } from './packet/extensions';
|
|
2
2
|
/** A pair of payload bytes and packet extensions which can be fed into a {@link DataTrackPacketizer}. */
|
|
3
3
|
export type DataTrackFrame = {
|
|
4
|
-
payload:
|
|
4
|
+
payload: NonSharedUint8Array;
|
|
5
5
|
userTimestamp?: bigint;
|
|
6
6
|
};
|
|
7
7
|
/** An internal representation o data track frame which contains all SFU metadata. */
|
|
8
8
|
export type DataTrackFrameInternal = {
|
|
9
|
-
payload:
|
|
9
|
+
payload: NonSharedUint8Array;
|
|
10
10
|
extensions: DataTrackExtensions;
|
|
11
11
|
};
|
|
12
12
|
export declare const DataTrackFrameInternal: {
|
|
13
13
|
from(frame: DataTrackFrame): {
|
|
14
|
-
payload: Uint8Array<
|
|
14
|
+
payload: Uint8Array<ArrayBuffer>;
|
|
15
15
|
extensions: DataTrackExtensions;
|
|
16
16
|
};
|
|
17
17
|
/** Converts from a DataTrackFrameInternal -> DataTrackFrame. Some internal information is
|
|
@@ -6,7 +6,7 @@ import type RemoteParticipant from '../../participant/RemoteParticipant';
|
|
|
6
6
|
import { DataTrackDepacketizerDropError } from '../depacketizer';
|
|
7
7
|
import type { DataTrackFrame } from '../frame';
|
|
8
8
|
import { DataTrackHandle } from '../handle';
|
|
9
|
-
import type { DataTrackInfo, DataTrackSid } from '../types';
|
|
9
|
+
import type { DataTrackInfo, DataTrackSid, RemoteDataTrackPipelineOptions } from '../types';
|
|
10
10
|
import { DataTrackSubscribeError } from './errors';
|
|
11
11
|
import type { EventSfuUpdateSubscription, EventTrackAvailable, EventTrackUnavailable } from './types';
|
|
12
12
|
export type DataTrackIncomingManagerCallbacks = {
|
|
@@ -40,6 +40,8 @@ export default class IncomingDataTrackManager extends IncomingDataTrackManager_b
|
|
|
40
40
|
constructor(options?: IncomingDataTrackManagerOptions);
|
|
41
41
|
/** @internal */
|
|
42
42
|
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
43
|
+
/** @internal */
|
|
44
|
+
setPipelineOptions(sid: DataTrackSid, options: RemoteDataTrackPipelineOptions): void;
|
|
43
45
|
/** Allocates a ReadableStream which emits when a new {@link DataTrackFrame} is received from the
|
|
44
46
|
* SFU. The SFU subscription is initiated lazily when the stream is created.
|
|
45
47
|
*
|
|
@@ -3,7 +3,7 @@ import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
|
3
3
|
import { DataTrackDepacketizerDropError } from '../depacketizer';
|
|
4
4
|
import type { DataTrackFrameInternal } from '../frame';
|
|
5
5
|
import { DataTrackPacket } from '../packet';
|
|
6
|
-
import type { DataTrackInfo } from '../types';
|
|
6
|
+
import type { DataTrackInfo, RemoteDataTrackPipelineOptions } from '../types';
|
|
7
7
|
/**
|
|
8
8
|
* Options for creating a {@link IncomingDataTrackPipeline}.
|
|
9
9
|
*/
|
|
@@ -11,6 +11,7 @@ type Options = {
|
|
|
11
11
|
info: DataTrackInfo;
|
|
12
12
|
publisherIdentity: string;
|
|
13
13
|
e2eeManager: BaseE2EEManager | null;
|
|
14
|
+
pipelineOptions?: RemoteDataTrackPipelineOptions;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* Pipeline for an individual data track subscription.
|
|
@@ -19,11 +20,13 @@ export default class IncomingDataTrackPipeline {
|
|
|
19
20
|
private publisherIdentity;
|
|
20
21
|
private e2eeManager;
|
|
21
22
|
private depacketizer;
|
|
23
|
+
private options;
|
|
22
24
|
/**
|
|
23
25
|
* Creates a new pipeline with the given options.
|
|
24
26
|
*/
|
|
25
27
|
constructor(options: Options);
|
|
26
28
|
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
29
|
+
setOptions(options: RemoteDataTrackPipelineOptions): void;
|
|
27
30
|
processPacket(packet: DataTrackPacket): Promise<Throws<DataTrackFrameInternal | null, DataTrackDepacketizerDropError>>;
|
|
28
31
|
/**
|
|
29
32
|
* Depacketize the given frame, log if a drop occurs.
|
|
@@ -12,7 +12,7 @@ export type SfuPublishResponseResult = {
|
|
|
12
12
|
data: DataTrackInfo;
|
|
13
13
|
} | {
|
|
14
14
|
type: 'error';
|
|
15
|
-
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.InvalidName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
15
|
+
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.InvalidName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached> | DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
16
16
|
};
|
|
17
17
|
/** Request sent to the SFU to publish a track. */
|
|
18
18
|
export type EventSfuPublishRequest = {
|
|
@@ -28,7 +28,7 @@ export type EventSfuUnpublishRequest = {
|
|
|
28
28
|
export type EventPacketAvailable = {
|
|
29
29
|
/** The handle associated with the data track which this packet bytes belong to. */
|
|
30
30
|
handle: DataTrackHandle;
|
|
31
|
-
bytes:
|
|
31
|
+
bytes: NonSharedUint8Array;
|
|
32
32
|
};
|
|
33
33
|
/** A track has been created by a local participant and is available to be
|
|
34
34
|
* subscribed to. */
|
|
@@ -26,15 +26,15 @@ export declare class DataTrackE2eeExtension extends DataTrackExtension {
|
|
|
26
26
|
static tag: DataTrackExtensionTag;
|
|
27
27
|
static lengthBytes: number;
|
|
28
28
|
keyIndex: number;
|
|
29
|
-
iv:
|
|
30
|
-
constructor(keyIndex: number, iv:
|
|
29
|
+
iv: NonSharedUint8Array;
|
|
30
|
+
constructor(keyIndex: number, iv: NonSharedUint8Array);
|
|
31
31
|
toBinaryLengthBytes(): number;
|
|
32
32
|
toBinaryInto(dataView: DataView): Throws<number, never>;
|
|
33
33
|
toJSON(): {
|
|
34
34
|
tag: number;
|
|
35
35
|
lengthBytes: number;
|
|
36
36
|
keyIndex: number;
|
|
37
|
-
iv: Uint8Array<
|
|
37
|
+
iv: Uint8Array<ArrayBuffer>;
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
export declare class DataTrackExtensions extends Serializable {
|
|
@@ -60,7 +60,7 @@ export declare class DataTrackExtensions extends Serializable {
|
|
|
60
60
|
tag: number;
|
|
61
61
|
lengthBytes: number;
|
|
62
62
|
keyIndex: number;
|
|
63
|
-
iv: Uint8Array<
|
|
63
|
+
iv: Uint8Array<ArrayBuffer>;
|
|
64
64
|
} | null;
|
|
65
65
|
};
|
|
66
66
|
}
|
|
@@ -43,7 +43,7 @@ export declare class DataTrackPacketHeader extends Serializable {
|
|
|
43
43
|
tag: number;
|
|
44
44
|
lengthBytes: number;
|
|
45
45
|
keyIndex: number;
|
|
46
|
-
iv: Uint8Array<
|
|
46
|
+
iv: Uint8Array<ArrayBuffer>;
|
|
47
47
|
} | null;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
@@ -62,8 +62,8 @@ export declare enum FrameMarker {
|
|
|
62
62
|
/** A class for serializing / deserializing data track packets. */
|
|
63
63
|
export declare class DataTrackPacket extends Serializable {
|
|
64
64
|
header: DataTrackPacketHeader;
|
|
65
|
-
payload:
|
|
66
|
-
constructor(header: DataTrackPacketHeader, payload:
|
|
65
|
+
payload: NonSharedUint8Array;
|
|
66
|
+
constructor(header: DataTrackPacketHeader, payload: NonSharedUint8Array);
|
|
67
67
|
toBinaryLengthBytes(): number;
|
|
68
68
|
toBinaryInto(dataView: DataView): Throws<number, DataTrackSerializeError>;
|
|
69
69
|
static fromBinary<Input extends DataView | ArrayBuffer | Uint8Array>(input: Input): Throws<[
|
|
@@ -87,11 +87,11 @@ export declare class DataTrackPacket extends Serializable {
|
|
|
87
87
|
tag: number;
|
|
88
88
|
lengthBytes: number;
|
|
89
89
|
keyIndex: number;
|
|
90
|
-
iv: Uint8Array<
|
|
90
|
+
iv: Uint8Array<ArrayBuffer>;
|
|
91
91
|
} | null;
|
|
92
92
|
};
|
|
93
93
|
};
|
|
94
|
-
payload: Uint8Array<
|
|
94
|
+
payload: Uint8Array<ArrayBuffer>;
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -7,6 +7,6 @@ export default abstract class Serializable {
|
|
|
7
7
|
/** Given a DataView, serialize the instance inside and return the number of bytes written. */
|
|
8
8
|
abstract toBinaryInto(dataView: DataView): Throws<number, DataTrackSerializeError>;
|
|
9
9
|
/** Encodes the instance as binary and returns the data as a Uint8Array. */
|
|
10
|
-
toBinary(): Throws<
|
|
10
|
+
toBinary(): Throws<NonSharedUint8Array, DataTrackSerializeError>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=serializable.d.ts.map
|
|
@@ -8,6 +8,13 @@ export type DataTrackInfo = {
|
|
|
8
8
|
name: string;
|
|
9
9
|
usesE2ee: boolean;
|
|
10
10
|
};
|
|
11
|
+
export type RemoteDataTrackPipelineOptions = {
|
|
12
|
+
/** Set the maximum number of in-flight partial frames the depacketizer will track
|
|
13
|
+
* concurrently for this track. Higher values give more out-of-order tolerance for
|
|
14
|
+
* high-frequency senders. Defaults to 1.
|
|
15
|
+
*/
|
|
16
|
+
maxPartialFrames?: number;
|
|
17
|
+
};
|
|
11
18
|
export declare const DataTrackInfo: {
|
|
12
19
|
from(protocolInfo: ProtocolDataTrackInfo): DataTrackInfo;
|
|
13
20
|
toProtobuf(info: DataTrackInfo): ProtocolDataTrackInfo;
|
|
@@ -198,7 +198,7 @@ export declare enum RoomEvent {
|
|
|
198
198
|
* Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
|
|
199
199
|
* All participants in the room will receive the messages sent to the room.
|
|
200
200
|
*
|
|
201
|
-
* args: (payload:
|
|
201
|
+
* args: (payload: NonSharedUint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
|
|
202
202
|
*/
|
|
203
203
|
DataReceived = "dataReceived",
|
|
204
204
|
/**
|
|
@@ -427,7 +427,7 @@ export declare enum ParticipantEvent {
|
|
|
427
427
|
* Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
|
|
428
428
|
* All participants in the room will receive the messages sent to the room.
|
|
429
429
|
*
|
|
430
|
-
* args: (payload:
|
|
430
|
+
* args: (payload: NonSharedUint8Array, kind: [[DataPacket_Kind]])
|
|
431
431
|
*/
|
|
432
432
|
DataReceived = "dataReceived",
|
|
433
433
|
/**
|
|
@@ -8,7 +8,7 @@ import LocalDataTrack from '../data-track/LocalDataTrack';
|
|
|
8
8
|
import type OutgoingDataTrackManager from '../data-track/outgoing/OutgoingDataTrackManager';
|
|
9
9
|
import type { DataTrackOptions } from '../data-track/outgoing/types';
|
|
10
10
|
import type { PerformRpcParams, RpcInvocationData } from '../rpc';
|
|
11
|
-
import { RpcError } from '../rpc';
|
|
11
|
+
import { RpcClientManager, RpcError, RpcServerManager } from '../rpc';
|
|
12
12
|
import LocalTrack from '../track/LocalTrack';
|
|
13
13
|
import LocalTrackPublication from '../track/LocalTrackPublication';
|
|
14
14
|
import { Track } from '../track/Track';
|
|
@@ -40,15 +40,14 @@ export default class LocalParticipant extends Participant {
|
|
|
40
40
|
private signalConnectedFuture?;
|
|
41
41
|
private activeAgentFuture?;
|
|
42
42
|
private firstActiveAgent?;
|
|
43
|
-
private rpcHandlers;
|
|
44
43
|
private roomOutgoingDataStreamManager;
|
|
45
44
|
private roomOutgoingDataTrackManager;
|
|
45
|
+
private rpcClientManager;
|
|
46
|
+
private rpcServerManager;
|
|
46
47
|
private pendingSignalRequests;
|
|
47
48
|
private enabledPublishVideoCodecs;
|
|
48
|
-
private pendingAcks;
|
|
49
|
-
private pendingResponses;
|
|
50
49
|
/** @internal */
|
|
51
|
-
constructor(sid: string, identity: string, engine: RTCEngine, options: InternalRoomOptions,
|
|
50
|
+
constructor(sid: string, identity: string, engine: RTCEngine, options: InternalRoomOptions, roomOutgoingDataStreamManager: OutgoingDataStreamManager, roomOutgoingDataTrackManager: OutgoingDataTrackManager, rpcClientManager: RpcClientManager, rpcServerManager: RpcServerManager);
|
|
52
51
|
get lastCameraError(): Error | undefined;
|
|
53
52
|
get lastMicrophoneError(): Error | undefined;
|
|
54
53
|
get isE2EEEnabled(): boolean;
|
|
@@ -63,7 +62,6 @@ export default class LocalParticipant extends Participant {
|
|
|
63
62
|
private handleClosing;
|
|
64
63
|
private handleSignalConnected;
|
|
65
64
|
private handleSignalRequestResponse;
|
|
66
|
-
private handleDataPacket;
|
|
67
65
|
/**
|
|
68
66
|
* Sets and updates the metadata of the local participant.
|
|
69
67
|
* Note: this requires `canUpdateOwnMetadata` permission.
|
|
@@ -148,6 +146,8 @@ export default class LocalParticipant extends Participant {
|
|
|
148
146
|
private waitUntilEngineConnected;
|
|
149
147
|
private hasPermissionsToPublish;
|
|
150
148
|
private publish;
|
|
149
|
+
private canPublishPacketTrailer;
|
|
150
|
+
private normalizeRequestedPacketTrailerOptions;
|
|
151
151
|
get isLocal(): boolean;
|
|
152
152
|
/** @internal
|
|
153
153
|
* publish additional codec to existing track
|
|
@@ -163,7 +163,7 @@ export default class LocalParticipant extends Participant {
|
|
|
163
163
|
* @param data Uint8Array of the payload. To send string data, use TextEncoder.encode
|
|
164
164
|
* @param options optionally specify a `reliable`, `topic` and `destination`
|
|
165
165
|
*/
|
|
166
|
-
publishData(data:
|
|
166
|
+
publishData(data: NonSharedUint8Array, options?: DataPublishOptions): Promise<void>;
|
|
167
167
|
/**
|
|
168
168
|
* Publish SIP DTMF message to the room.
|
|
169
169
|
*
|
|
@@ -220,7 +220,7 @@ export default class LocalParticipant extends Participant {
|
|
|
220
220
|
* @returns A promise that resolves with the response payload or rejects with an error.
|
|
221
221
|
* @throws Error on failure. Details in `message`.
|
|
222
222
|
*/
|
|
223
|
-
performRpc(
|
|
223
|
+
performRpc(params: PerformRpcParams): TypedPromise<string, RpcError>;
|
|
224
224
|
/**
|
|
225
225
|
* @deprecated use `room.registerRpcMethod` instead
|
|
226
226
|
*/
|
|
@@ -247,12 +247,6 @@ export default class LocalParticipant extends Participant {
|
|
|
247
247
|
* participant/track. Any omitted participants will not receive any permissions.
|
|
248
248
|
*/
|
|
249
249
|
setTrackSubscriptionPermissions(allParticipantsAllowed: boolean, participantTrackPermissions?: ParticipantTrackPermission[]): void;
|
|
250
|
-
private handleIncomingRpcAck;
|
|
251
|
-
private handleIncomingRpcResponse;
|
|
252
|
-
/** @internal */
|
|
253
|
-
private publishRpcRequest;
|
|
254
|
-
/** @internal */
|
|
255
|
-
handleParticipantDisconnected(participantIdentity: string): void;
|
|
256
250
|
/** @internal */
|
|
257
251
|
setEnabledPublishCodecs(codecs: Codec[]): void;
|
|
258
252
|
/** @internal */
|
|
@@ -124,7 +124,7 @@ export type ParticipantEventCallbacks = {
|
|
|
124
124
|
localSenderCreated: (sender: RTCRtpSender, track: Track) => void;
|
|
125
125
|
participantMetadataChanged: (prevMetadata: string | undefined, participant?: any) => void;
|
|
126
126
|
participantNameChanged: (name: string) => void;
|
|
127
|
-
dataReceived: (payload:
|
|
127
|
+
dataReceived: (payload: NonSharedUint8Array, kind: DataPacket_Kind, encryptionType?: Encryption_Type) => void;
|
|
128
128
|
sipDTMFReceived: (dtmf: SipDTMF) => void;
|
|
129
129
|
transcriptionReceived: (transcription: TranscriptionSegment[], publication?: TrackPublication) => void;
|
|
130
130
|
isSpeakingChanged: (speaking: boolean) => void;
|
|
@@ -22,6 +22,10 @@ export default class RemoteParticipant extends Participant {
|
|
|
22
22
|
* const track = await remoteParticipant.dataTracks.getDeferred("data track name"); */
|
|
23
23
|
dataTracks: DeferrableMap<RemoteDataTrack['info']['name'], RemoteDataTrack>;
|
|
24
24
|
signalClient: SignalClient;
|
|
25
|
+
/** A version number indicating the set of features that the report participant's client supports.
|
|
26
|
+
* @internal
|
|
27
|
+
**/
|
|
28
|
+
clientProtocol: number;
|
|
25
29
|
private volumeMap;
|
|
26
30
|
private audioOutput?;
|
|
27
31
|
/** @internal */
|
|
@@ -31,7 +35,7 @@ export default class RemoteParticipant extends Participant {
|
|
|
31
35
|
remoteParticipant: string;
|
|
32
36
|
};
|
|
33
37
|
/** @internal */
|
|
34
|
-
constructor(signalClient: SignalClient, sid: string, identity?: string, name?: string, metadata?: string, attributes?: Record<string, string>, loggerOptions?: LoggerOptions, kind?: ParticipantKind, remoteDataTracks?: Array<RemoteDataTrack
|
|
38
|
+
constructor(signalClient: SignalClient, sid: string, identity?: string, name?: string, metadata?: string, attributes?: Record<string, string>, loggerOptions?: LoggerOptions, kind?: ParticipantKind, remoteDataTracks?: Array<RemoteDataTrack>, clientProtocol?: number);
|
|
35
39
|
protected addTrackPublication(publication: RemoteTrackPublication): void;
|
|
36
40
|
getTrackPublication(source: Track.Source): RemoteTrackPublication | undefined;
|
|
37
41
|
getTrackPublicationByName(name: string): RemoteTrackPublication | undefined;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type TypedEmitter from 'typed-emitter';
|
|
2
|
+
import type { StructuredLogger } from '../../../logger';
|
|
3
|
+
import type { TextStreamReader } from '../../data-stream/incoming/StreamReader';
|
|
4
|
+
import type OutgoingDataStreamManager from '../../data-stream/outgoing/OutgoingDataStreamManager';
|
|
5
|
+
import type Participant from '../../participant/Participant';
|
|
6
|
+
import type { PerformRpcParams } from '../utils';
|
|
7
|
+
import { RpcError } from '../utils';
|
|
8
|
+
import type { RpcClientManagerCallbacks } from './events';
|
|
9
|
+
declare const RpcClientManager_base: new () => TypedEmitter<RpcClientManagerCallbacks>;
|
|
10
|
+
/**
|
|
11
|
+
* Manages the client (caller) side of RPC: sending requests, tracking pending
|
|
12
|
+
* ack/response state, and handling incoming ack/response packets.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export default class RpcClientManager extends RpcClientManager_base {
|
|
16
|
+
private log;
|
|
17
|
+
private outgoingDataStreamManager;
|
|
18
|
+
private getRemoteParticipantClientProtocol;
|
|
19
|
+
private getServerVersion;
|
|
20
|
+
private pendingAcks;
|
|
21
|
+
private pendingResponses;
|
|
22
|
+
constructor(log: StructuredLogger, outgoingDataStreamManager: OutgoingDataStreamManager, getRemoteParticipantClientProtocol: (identity: Participant['identity']) => number, getServerVersion: () => string | undefined);
|
|
23
|
+
performRpc({ destinationIdentity, method, payload, responseTimeout: responseTimeoutMs, }: PerformRpcParams): Promise<[
|
|
24
|
+
id: string,
|
|
25
|
+
completionPromise: Promise<string>
|
|
26
|
+
]>;
|
|
27
|
+
private publishRpcRequest;
|
|
28
|
+
/**
|
|
29
|
+
* Handle an incoming data stream containing an RPC response payload.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
handleIncomingDataStream(reader: TextStreamReader, senderIdentity: Participant['identity'], attributes: Record<string, string>): Promise<void>;
|
|
33
|
+
/** @internal */
|
|
34
|
+
handleIncomingRpcResponseSuccess(requestId: string, payload: string): void;
|
|
35
|
+
/** @internal */
|
|
36
|
+
handleIncomingRpcResponseFailure(requestId: string, error: RpcError): void;
|
|
37
|
+
/** @internal */
|
|
38
|
+
handleIncomingRpcAck(requestId: string): void;
|
|
39
|
+
/** @internal */
|
|
40
|
+
handleParticipantDisconnected(participantIdentity: string): void;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=RpcClientManager.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as RpcClientManager } from './client/RpcClientManager';
|
|
2
|
+
export type { RpcClientManagerCallbacks } from './client/events';
|
|
3
|
+
export { default as RpcServerManager } from './server/RpcServerManager';
|
|
4
|
+
export type { RpcServerManagerCallbacks } from './server/events';
|
|
5
|
+
export type { PerformRpcParams, RpcInvocationData } from './utils';
|
|
6
|
+
export { RPC_REQUEST_DATA_STREAM_TOPIC, RPC_RESPONSE_DATA_STREAM_TOPIC, RpcRequestAttrs, RpcError, byteLength, truncateBytes } from './utils';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { RpcRequest } from '@livekit/protocol';
|
|
2
|
+
import type TypedEmitter from 'typed-emitter';
|
|
3
|
+
import type { StructuredLogger } from '../../../logger';
|
|
4
|
+
import type { TextStreamReader } from '../../data-stream/incoming/StreamReader';
|
|
5
|
+
import type OutgoingDataStreamManager from '../../data-stream/outgoing/OutgoingDataStreamManager';
|
|
6
|
+
import type Participant from '../../participant/Participant';
|
|
7
|
+
import type { RpcInvocationData } from '../utils';
|
|
8
|
+
import type { RpcServerManagerCallbacks } from './events';
|
|
9
|
+
declare const RpcServerManager_base: new () => TypedEmitter<RpcServerManagerCallbacks>;
|
|
10
|
+
/**
|
|
11
|
+
* Manages the server (handler) side of RPC: processing incoming requests,
|
|
12
|
+
* managing registered method handlers, and sending responses.
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export default class RpcServerManager extends RpcServerManager_base {
|
|
16
|
+
private log;
|
|
17
|
+
private outgoingDataStreamManager;
|
|
18
|
+
private getRemoteParticipantClientProtocol;
|
|
19
|
+
private rpcHandlers;
|
|
20
|
+
constructor(log: StructuredLogger, outgoingDataStreamManager: OutgoingDataStreamManager, getRemoteParticipantClientProtocol: (identity: Participant['identity']) => number);
|
|
21
|
+
registerRpcMethod(method: string, handler: (data: RpcInvocationData) => Promise<string>): void;
|
|
22
|
+
unregisterRpcMethod(method: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Handle an incoming RPCRequest message containing a payload.
|
|
25
|
+
* This handles "version 1" of rpc requests.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
handleIncomingRpcRequest(callerIdentity: string, rpcRequest: RpcRequest): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Handle an incoming data stream containing a RPC request payload.
|
|
31
|
+
* This handles "version 2" of rpc requests.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
handleIncomingDataStream(reader: TextStreamReader, callerIdentity: Participant['identity'], dataStreamAttrs: Record<string, string>): Promise<void>;
|
|
35
|
+
private publishRpcAck;
|
|
36
|
+
private publishRpcResponsePacket;
|
|
37
|
+
/**
|
|
38
|
+
* Send a successful RPC response payload, choosing the transport based on
|
|
39
|
+
* the caller's client protocol version.
|
|
40
|
+
*/
|
|
41
|
+
private publishRpcResponse;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=RpcServerManager.d.ts.map
|
|
@@ -49,6 +49,7 @@ export declare class RpcError extends Error {
|
|
|
49
49
|
static MAX_DATA_BYTES: number;
|
|
50
50
|
code: number;
|
|
51
51
|
data?: string;
|
|
52
|
+
cause?: unknown;
|
|
52
53
|
/**
|
|
53
54
|
* Creates an error object with the given code and message, plus an optional data payload.
|
|
54
55
|
*
|
|
@@ -56,7 +57,9 @@ export declare class RpcError extends Error {
|
|
|
56
57
|
*
|
|
57
58
|
* Error codes 1001-1999 are reserved for built-in errors (see RpcError.ErrorCode for their meanings).
|
|
58
59
|
*/
|
|
59
|
-
constructor(code: number, message: string, data?: string
|
|
60
|
+
constructor(code: number, message: string, data?: string, options?: {
|
|
61
|
+
cause?: unknown;
|
|
62
|
+
});
|
|
60
63
|
/**
|
|
61
64
|
* @internal
|
|
62
65
|
*/
|
|
@@ -87,9 +90,36 @@ export declare class RpcError extends Error {
|
|
|
87
90
|
*
|
|
88
91
|
* @internal
|
|
89
92
|
*/
|
|
90
|
-
static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string
|
|
93
|
+
static builtIn(key: keyof typeof RpcError.ErrorCode, data?: string, options?: {
|
|
94
|
+
cause?: unknown;
|
|
95
|
+
}): RpcError;
|
|
91
96
|
}
|
|
92
|
-
export declare const
|
|
97
|
+
export declare const MAX_V1_PAYLOAD_BYTES = 15360;
|
|
98
|
+
/**
|
|
99
|
+
* Topic used for v2 RPC request data streams.
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export declare const RPC_REQUEST_DATA_STREAM_TOPIC = "lk.rpc_request";
|
|
103
|
+
/**
|
|
104
|
+
* Topic used for v2 RPC response data streams.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export declare const RPC_RESPONSE_DATA_STREAM_TOPIC = "lk.rpc_response";
|
|
108
|
+
/** @internal */
|
|
109
|
+
export declare enum RpcRequestAttrs {
|
|
110
|
+
RPC_REQUEST_ID = "lk.rpc_request_id",
|
|
111
|
+
RPC_REQUEST_METHOD = "lk.rpc_request_method",
|
|
112
|
+
RPC_REQUEST_RESPONSE_TIMEOUT_MS = "lk.rpc_request_response_timeout_ms",
|
|
113
|
+
RPC_REQUEST_VERSION = "lk.rpc_request_version"
|
|
114
|
+
}
|
|
115
|
+
/** Initial version of rpc which uses RpcRequest / RpcResponse messages.
|
|
116
|
+
* @internal
|
|
117
|
+
**/
|
|
118
|
+
export declare const RPC_VERSION_V1 = 1;
|
|
119
|
+
/** Rpc version backed by data streams instead of RpcRequest / RpcResponse.
|
|
120
|
+
* @internal
|
|
121
|
+
**/
|
|
122
|
+
export declare const RPC_VERSION_V2 = 2;
|
|
93
123
|
/**
|
|
94
124
|
* @internal
|
|
95
125
|
*/
|
|
@@ -98,4 +128,4 @@ export declare function byteLength(str: string): number;
|
|
|
98
128
|
* @internal
|
|
99
129
|
*/
|
|
100
130
|
export declare function truncateBytes(str: string, maxBytes: number): string;
|
|
101
|
-
//# sourceMappingURL=
|
|
131
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PacketTrailerMetadata } from '../../packetTrailer/types';
|
|
2
|
+
/**
|
|
3
|
+
* Caches packet trailer metadata extracted from received video frames,
|
|
4
|
+
* keyed by RTP timestamp so it can be looked up when the frame is displayed.
|
|
5
|
+
*
|
|
6
|
+
* Metadata is populated either by the packet trailer worker managed by
|
|
7
|
+
* `PacketTrailerManager` (non-E2EE) or by the E2EE FrameCryptor worker
|
|
8
|
+
* after decryption (E2EE).
|
|
9
|
+
*
|
|
10
|
+
* @experimental
|
|
11
|
+
*/
|
|
12
|
+
export declare class PacketTrailerExtractor {
|
|
13
|
+
private metadataMap;
|
|
14
|
+
private activeSsrc;
|
|
15
|
+
storeMetadata(rtpTimestamp: number, ssrc: number, metadata: PacketTrailerMetadata): void;
|
|
16
|
+
lookupMetadata(rtpTimestamp: number): PacketTrailerMetadata | undefined;
|
|
17
|
+
dispose(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=PacketTrailerExtractor.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { PacketTrailerMetadata } from '../../packetTrailer/types';
|
|
1
2
|
import type { VideoReceiverStats } from '../stats';
|
|
2
3
|
import type { LoggerOptions } from '../types';
|
|
4
|
+
import type { PacketTrailerExtractor } from './PacketTrailerExtractor';
|
|
3
5
|
import RemoteTrack from './RemoteTrack';
|
|
4
6
|
import { Track } from './Track';
|
|
5
7
|
import type { AdaptiveStreamSettings } from './types';
|
|
@@ -9,8 +11,22 @@ export default class RemoteVideoTrack extends RemoteTrack<Track.Kind.Video> {
|
|
|
9
11
|
private adaptiveStreamSettings?;
|
|
10
12
|
private lastVisible?;
|
|
11
13
|
private lastDimensions?;
|
|
14
|
+
/** @internal */
|
|
15
|
+
packetTrailerExtractor?: PacketTrailerExtractor;
|
|
12
16
|
constructor(mediaTrack: MediaStreamTrack, sid: string, receiver: RTCRtpReceiver, adaptiveStreamSettings?: AdaptiveStreamSettings, loggerOptions?: LoggerOptions);
|
|
13
17
|
get isAdaptiveStream(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Look up frame-level metadata for a given RTP timestamp.
|
|
20
|
+
* Use with the `TrackEvent.TimeSyncUpdate` event to correlate displayed frames
|
|
21
|
+
* with their capture-time metadata.
|
|
22
|
+
*
|
|
23
|
+
* Requires the room to be configured with the `packetTrailer` worker option
|
|
24
|
+
* and the publishing track to have packet trailer features enabled.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
lookupFrameMetadata({ rtpTimestamp, }: {
|
|
28
|
+
rtpTimestamp: number;
|
|
29
|
+
}): PacketTrailerMetadata | undefined;
|
|
14
30
|
setStreamState(value: Track.StreamState): void;
|
|
15
31
|
/**
|
|
16
32
|
* Note: When using adaptiveStream, you need to use remoteVideoTrack.attach() to add the track to a HTMLVideoElement, otherwise your video tracks might never start
|