livekit-client 2.18.8 → 2.18.10
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 +2898 -2431
- 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 -1
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +3 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/data-track/LocalDataTrack.d.ts +2 -1
- package/dist/src/room/data-track/LocalDataTrack.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/OutgoingDataTrackManager.d.ts +2 -2
- package/dist/src/room/data-track/outgoing/OutgoingDataTrackManager.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/types.d.ts +4 -3
- 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 +3 -1
- 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/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 +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 -1
- package/dist/ts4.2/room/Room.d.ts +3 -1
- package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +2 -1
- 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/OutgoingDataTrackManager.d.ts +2 -2
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +4 -3
- 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 +3 -1
- package/dist/ts4.2/room/participant/Participant.d.ts +1 -1
- 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 +1 -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 -20
- package/src/room/Room.test.ts +62 -1
- package/src/room/Room.ts +28 -5
- package/src/room/data-track/LocalDataTrack.ts +15 -7
- 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/OutgoingDataTrackManager.test.ts +350 -198
- package/src/room/data-track/outgoing/OutgoingDataTrackManager.ts +9 -3
- package/src/room/data-track/outgoing/types.ts +4 -3
- 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 +48 -7
- package/src/room/participant/Participant.ts +1 -1
- package/src/room/participant/publishUtils.ts +1 -1
- 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 +17 -3
- 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 +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type TypedEventEmitter from 'typed-emitter';
|
|
2
|
+
import type { PacketTrailerPublishOptions } from '../../packetTrailer/types';
|
|
2
3
|
import type { VideoCodec } from '../../room/track/options';
|
|
3
4
|
import type { CryptorCallbacks } from '../events';
|
|
4
5
|
import type { KeyProviderOptions } from '../types';
|
|
@@ -37,6 +38,14 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
|
37
38
|
private sifTrailer;
|
|
38
39
|
private detectedCodec?;
|
|
39
40
|
private currentTransform?;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the subscribed track advertises packet trailer features.
|
|
43
|
+
* When false, we skip the per-frame trailer extraction path entirely
|
|
44
|
+
* on decode to avoid unnecessary work on tracks that don't use it.
|
|
45
|
+
*/
|
|
46
|
+
private hasPacketTrailer;
|
|
47
|
+
private packetTrailer?;
|
|
48
|
+
private packetTrailerFrameId;
|
|
40
49
|
/**
|
|
41
50
|
* Throttling mechanism for decryption errors to prevent memory leaks
|
|
42
51
|
*/
|
|
@@ -49,7 +58,7 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
|
49
58
|
keys: ParticipantKeyHandler;
|
|
50
59
|
participantIdentity: string;
|
|
51
60
|
keyProviderOptions: KeyProviderOptions;
|
|
52
|
-
sifTrailer?:
|
|
61
|
+
sifTrailer?: NonSharedUint8Array;
|
|
53
62
|
});
|
|
54
63
|
private get logContext();
|
|
55
64
|
/**
|
|
@@ -73,8 +82,15 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
|
73
82
|
* @param map
|
|
74
83
|
*/
|
|
75
84
|
setRtpMap(map: Map<number, VideoCodec>): void;
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Sets whether the track associated with this cryptor carries packet
|
|
87
|
+
* trailer data. When false, {@link decodeFunction} skips the per-frame
|
|
88
|
+
* trailer extraction branch entirely.
|
|
89
|
+
*/
|
|
90
|
+
setHasPacketTrailer(hasPacketTrailer: boolean): void;
|
|
91
|
+
setPacketTrailer(packetTrailer?: PacketTrailerPublishOptions): void;
|
|
92
|
+
setupTransform(operation: 'encode' | 'decode', readable: ReadableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, writable: WritableStream<RTCEncodedVideoFrame | RTCEncodedAudioFrame>, trackId: string, isReuse: boolean, codec?: VideoCodec, packetTrailer?: PacketTrailerPublishOptions): void;
|
|
93
|
+
setSifTrailer(trailer: NonSharedUint8Array): void;
|
|
78
94
|
/**
|
|
79
95
|
* Checks if we should emit an error based on throttling rules to prevent memory leaks
|
|
80
96
|
* @param errorKey - unique key identifying the error context
|
|
@@ -109,6 +125,7 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
|
109
125
|
* 9) Enqueue the encrypted frame for sending.
|
|
110
126
|
*/
|
|
111
127
|
protected encodeFunction(encodedFrame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, controller: TransformStreamDefaultController): Promise<void>;
|
|
128
|
+
private appendPacketTrailer;
|
|
112
129
|
/**
|
|
113
130
|
* Function that will be injected in a stream and will decrypt the given encoded frames.
|
|
114
131
|
*
|
|
@@ -152,6 +169,6 @@ export declare class FrameCryptor extends BaseFrameCryptor {
|
|
|
152
169
|
* by the livekit server and thus to be treated as unencrypted
|
|
153
170
|
* @internal
|
|
154
171
|
*/
|
|
155
|
-
export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes:
|
|
172
|
+
export declare function isFrameServerInjected(frameData: ArrayBuffer, trailerBytes: NonSharedUint8Array): boolean;
|
|
156
173
|
export {};
|
|
157
174
|
//# sourceMappingURL=FrameCryptor.d.ts.map
|
|
@@ -23,5 +23,5 @@ export interface NALUProcessingResult {
|
|
|
23
23
|
* @param knownCodec Known codec from other sources (optional)
|
|
24
24
|
* @returns NALU processing result
|
|
25
25
|
*/
|
|
26
|
-
export declare function processNALUsForEncryption(data:
|
|
26
|
+
export declare function processNALUsForEncryption(data: NonSharedUint8Array, knownCodec?: 'h264' | 'h265'): NALUProcessingResult;
|
|
27
27
|
//# sourceMappingURL=naluUtils.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { VideoCodec } from '../..';
|
|
2
|
-
export declare const VP8KeyFrame8x8:
|
|
3
|
-
export declare const H264KeyFrame2x2SPS:
|
|
4
|
-
export declare const H264KeyFrame2x2PPS:
|
|
5
|
-
export declare const H264KeyFrame2x2IDR:
|
|
6
|
-
export declare const H264KeyFrame2x2:
|
|
7
|
-
export declare const OpusSilenceFrame:
|
|
2
|
+
export declare const VP8KeyFrame8x8: NonSharedUint8Array;
|
|
3
|
+
export declare const H264KeyFrame2x2SPS: NonSharedUint8Array;
|
|
4
|
+
export declare const H264KeyFrame2x2PPS: NonSharedUint8Array;
|
|
5
|
+
export declare const H264KeyFrame2x2IDR: NonSharedUint8Array;
|
|
6
|
+
export declare const H264KeyFrame2x2: NonSharedUint8Array[];
|
|
7
|
+
export declare const OpusSilenceFrame: NonSharedUint8Array;
|
|
8
8
|
/**
|
|
9
9
|
* Pre-computed SHA-256 hashes for secure comparison operations
|
|
10
10
|
*/
|
|
@@ -18,5 +18,5 @@ export declare const CryptoHashes: {
|
|
|
18
18
|
/**
|
|
19
19
|
* Check if a byte array matches any of the known SIF payload frame types using secure crypto hashes
|
|
20
20
|
*/
|
|
21
|
-
export declare function identifySifPayload(data:
|
|
21
|
+
export declare function identifySifPayload(data: NonSharedUint8Array | ArrayBuffer): Promise<VideoCodec | 'opus' | null>;
|
|
22
22
|
//# sourceMappingURL=sifPayload.d.ts.map
|
package/dist/ts4.2/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import Room, { ConnectionState } from './room/Room';
|
|
|
8
8
|
import * as attributes from './room/attribute-typings';
|
|
9
9
|
import LocalDataTrack from './room/data-track/LocalDataTrack';
|
|
10
10
|
import type RemoteDataTrack, { DataTrackSubscribeOptions } from './room/data-track/RemoteDataTrack';
|
|
11
|
+
import type { RemoteDataTrackPipelineOptions } from './room/data-track/types';
|
|
11
12
|
import LocalParticipant from './room/participant/LocalParticipant';
|
|
12
13
|
import type Participant, { ParticipantEventCallbacks } from './room/participant/Participant';
|
|
13
14
|
import Participant, { ConnectionQuality, ParticipantKind } from './room/participant/Participant';
|
|
@@ -32,6 +33,9 @@ import { compareVersions, createAudioAnalyser, getEmptyAudioStreamTrack, getEmpt
|
|
|
32
33
|
import { getBrowser } from './utils/browserParser';
|
|
33
34
|
export type { RpcInvocationData, PerformRpcParams } from './room/rpc';
|
|
34
35
|
export { RpcError } from './room/rpc';
|
|
36
|
+
export type { PacketTrailerMetadata, PacketTrailerPublishOptions } from './packetTrailer/types';
|
|
37
|
+
export type { PacketTrailerOptions } from './packetTrailer/PacketTrailerManager';
|
|
38
|
+
export { PacketTrailerManager } from './packetTrailer/PacketTrailerManager';
|
|
35
39
|
export * from './connectionHelper/ConnectionCheck';
|
|
36
40
|
export * from './connectionHelper/checks/Checker';
|
|
37
41
|
export * from './e2ee';
|
|
@@ -54,7 +58,7 @@ export * from './version';
|
|
|
54
58
|
export {
|
|
55
59
|
/** @internal */
|
|
56
60
|
attributes, ConnectionQuality, ConnectionState, CriticalTimers, DataPacket_Kind, Encryption_Type, DefaultReconnectPolicy, DisconnectReason, LocalAudioTrack, LocalParticipant, LocalTrack, LocalTrackPublication, LocalVideoTrack, LogLevel, LoggerNames, Participant, RemoteAudioTrack, RemoteParticipant, ParticipantKind, RemoteTrack, RemoteTrackPublication, RemoteVideoTrack, Room, SubscriptionError, TrackPublication, TrackType, compareVersions, createAudioAnalyser, getBrowser, getEmptyAudioStreamTrack, getEmptyVideoStreamTrack, getLogger, isBrowserSupported, setLogExtension, setLogLevel, supportsAV1, supportsAdaptiveStream, supportsAudioOutputSelection, supportsDynacast, supportsVP9, Mutex, isAudioCodec, isAudioTrack, isLocalTrack, isRemoteTrack, isVideoCodec, isVideoTrack, isLocalParticipant, isRemoteParticipant, LocalDataTrack, RemoteDataTrack, };
|
|
57
|
-
export type { AudioAnalyserOptions, ElementInfo, LiveKitReactNativeInfo, TextStreamInfo, ParticipantTrackPermission, AudioReceiverStats, AudioSenderStats, VideoReceiverStats, VideoSenderStats, ReconnectContext, ReconnectPolicy, RoomEventCallbacks, ParticipantEventCallbacks, PublicationEventCallbacks, DataTrackSubscribeOptions, };
|
|
61
|
+
export type { AudioAnalyserOptions, ElementInfo, LiveKitReactNativeInfo, TextStreamInfo, ParticipantTrackPermission, AudioReceiverStats, AudioSenderStats, VideoReceiverStats, VideoSenderStats, ReconnectContext, ReconnectPolicy, RoomEventCallbacks, ParticipantEventCallbacks, PublicationEventCallbacks, DataTrackSubscribeOptions, RemoteDataTrackPipelineOptions, };
|
|
58
62
|
export type { DataTrackPacketHeader } from './room/data-track/packet';
|
|
59
63
|
export { DataTrackPacket } from './room/data-track/packet';
|
|
60
64
|
export type { DataTrackExtensions, DataTrackUserTimestampExtension, DataTrackE2eeExtension } from './room/data-track/packet/extensions';
|
package/dist/ts4.2/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { E2EEOptions } from './e2ee/types';
|
|
2
|
+
import type { PacketTrailerOptions } from './packetTrailer/PacketTrailerManager';
|
|
2
3
|
import type { ReconnectPolicy } from './room/ReconnectPolicy';
|
|
3
4
|
import type { AudioCaptureOptions, AudioOutputOptions, TrackPublishDefaults, VideoCaptureOptions } from './room/track/options';
|
|
4
5
|
import type { AdaptiveStreamSettings } from './room/track/types';
|
|
@@ -78,6 +79,12 @@ export interface InternalRoomOptions {
|
|
|
78
79
|
*/
|
|
79
80
|
encryption?: E2EEOptions;
|
|
80
81
|
loggerName?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @experimental
|
|
84
|
+
* Options for enabling packet trailers on video tracks.
|
|
85
|
+
* Packet trailers carry frame-level metadata such as user timestamps and frame IDs.
|
|
86
|
+
*/
|
|
87
|
+
packetTrailer?: PacketTrailerOptions;
|
|
81
88
|
/**
|
|
82
89
|
* will attempt to connect via single peer connection mode.
|
|
83
90
|
* falls back to dual peer connection mode if not available.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type Room from '../room/Room';
|
|
2
|
+
export interface PacketTrailerOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Dedicated worker for extracting packet trailers off the main thread.
|
|
5
|
+
*
|
|
6
|
+
* Encoded video streams are transferred to the worker for processing, which
|
|
7
|
+
* avoids per-frame work on the main thread.
|
|
8
|
+
*/
|
|
9
|
+
worker: Worker;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Manages packet trailer extraction for received video tracks.
|
|
13
|
+
*
|
|
14
|
+
* When a track's TrackInfo indicates packet trailer features, the manager
|
|
15
|
+
* wires up an encoded frame transform to strip the trailer from encoded frames
|
|
16
|
+
* and cache the metadata for lookup.
|
|
17
|
+
*
|
|
18
|
+
* Packet trailer extraction is worker-only. If no worker is configured, the
|
|
19
|
+
* SDK does not advertise packet trailer support and skips extraction.
|
|
20
|
+
*
|
|
21
|
+
* When E2EE is active, the E2EE FrameCryptor worker handles trailer
|
|
22
|
+
* extraction directly (before decryption), so this manager only creates
|
|
23
|
+
* the extractor/metadata cache — no separate pipeline is installed.
|
|
24
|
+
*
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
export declare class PacketTrailerManager {
|
|
28
|
+
private worker?;
|
|
29
|
+
private room?;
|
|
30
|
+
private extractors;
|
|
31
|
+
/**
|
|
32
|
+
* Tracks the trackId associated with each receiver that has had its
|
|
33
|
+
* encoded streams handed off to the worker. Used to detect receiver
|
|
34
|
+
* reuse (transceiver recycling) so we can remap trackIds instead of
|
|
35
|
+
* re-transferring already-consumed streams.
|
|
36
|
+
*/
|
|
37
|
+
private workerPipelines;
|
|
38
|
+
constructor(options?: PacketTrailerOptions);
|
|
39
|
+
/** @internal */
|
|
40
|
+
setup(room: Room): void;
|
|
41
|
+
private setupReceiver;
|
|
42
|
+
private setupPassthroughReceiver;
|
|
43
|
+
private setupWorkerReceiver;
|
|
44
|
+
private teardownTrack;
|
|
45
|
+
private cleanup;
|
|
46
|
+
private onWorkerMessage;
|
|
47
|
+
private onWorkerError;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=PacketTrailerManager.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { PacketTrailerMetadata, PacketTrailerPublishOptions } from './types';
|
|
2
|
+
export declare const PACKET_TRAILER_MAGIC: Uint8Array<ArrayBuffer>;
|
|
3
|
+
export declare const PACKET_TRAILER_TIMESTAMP_TAG = 1;
|
|
4
|
+
export declare const PACKET_TRAILER_FRAME_ID_TAG = 2;
|
|
5
|
+
export declare const PACKET_TRAILER_ENVELOPE_SIZE = 5;
|
|
6
|
+
export interface ExtractPacketTrailerResult {
|
|
7
|
+
data: Uint8Array;
|
|
8
|
+
metadata?: PacketTrailerMetadata;
|
|
9
|
+
}
|
|
10
|
+
export declare function appendPacketTrailer(data: Uint8Array, userTimestamp: bigint, frameId: number): Uint8Array;
|
|
11
|
+
export declare function appendPacketTrailerToEncodedFrame(frame: RTCEncodedVideoFrame, options: PacketTrailerPublishOptions | undefined, frameId: number): boolean;
|
|
12
|
+
export declare function extractPacketTrailer(data: ArrayBuffer | Uint8Array): ExtractPacketTrailerResult;
|
|
13
|
+
export declare function getFrameRtpTimestamp(frame: RTCEncodedVideoFrame | RTCEncodedAudioFrame): number | undefined;
|
|
14
|
+
export declare function getFrameSsrc(frame: RTCEncodedVideoFrame | RTCEncodedAudioFrame): number;
|
|
15
|
+
export interface PacketTrailerFramePayload {
|
|
16
|
+
trackId: string;
|
|
17
|
+
rtpTimestamp: number;
|
|
18
|
+
ssrc: number;
|
|
19
|
+
metadata: PacketTrailerMetadata;
|
|
20
|
+
}
|
|
21
|
+
export interface ProcessPacketTrailerResult {
|
|
22
|
+
data?: ArrayBuffer;
|
|
23
|
+
payload?: PacketTrailerFramePayload;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Extracts a packet trailer from an encoded frame and returns the stripped
|
|
27
|
+
* frame data (if any) along with a ready-to-post metadata payload. Returns an
|
|
28
|
+
* empty object when no trailer is present, an RTP timestamp can't be read, or
|
|
29
|
+
* a trackId isn't available.
|
|
30
|
+
*/
|
|
31
|
+
export declare function processPacketTrailer(frame: RTCEncodedVideoFrame | RTCEncodedAudioFrame, trackId: string | undefined): ProcessPacketTrailerResult;
|
|
32
|
+
//# sourceMappingURL=packetTrailer.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { PacketTrailerFramePayload } from './packetTrailer';
|
|
2
|
+
export interface PacketTrailerMetadata {
|
|
3
|
+
userTimestamp: bigint;
|
|
4
|
+
frameId: number;
|
|
5
|
+
}
|
|
6
|
+
export interface PacketTrailerPublishOptions {
|
|
7
|
+
timestamp?: boolean;
|
|
8
|
+
frameId?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface PTBaseMessage {
|
|
11
|
+
kind: string;
|
|
12
|
+
data?: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface PTInitMessage extends PTBaseMessage {
|
|
15
|
+
kind: 'init';
|
|
16
|
+
}
|
|
17
|
+
export interface PTInitAck extends PTBaseMessage {
|
|
18
|
+
kind: 'initAck';
|
|
19
|
+
}
|
|
20
|
+
export interface PTDecodeMessage extends PTBaseMessage {
|
|
21
|
+
kind: 'decode';
|
|
22
|
+
data: {
|
|
23
|
+
readableStream: ReadableStream;
|
|
24
|
+
writableStream: WritableStream;
|
|
25
|
+
trackId: string;
|
|
26
|
+
hasPacketTrailer: boolean;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface PTEncodeMessage extends PTBaseMessage {
|
|
30
|
+
kind: 'encode';
|
|
31
|
+
data: {
|
|
32
|
+
readableStream: ReadableStream;
|
|
33
|
+
writableStream: WritableStream;
|
|
34
|
+
packetTrailer?: PacketTrailerPublishOptions;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export type PTScriptTransformOptions = {
|
|
38
|
+
kind: 'decode';
|
|
39
|
+
trackId: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'encode';
|
|
42
|
+
packetTrailer?: PacketTrailerPublishOptions;
|
|
43
|
+
};
|
|
44
|
+
export interface PTMetadataMessage extends PTBaseMessage {
|
|
45
|
+
kind: 'metadata';
|
|
46
|
+
data: PacketTrailerFramePayload;
|
|
47
|
+
}
|
|
48
|
+
export interface PTUpdateTrackIdMessage extends PTBaseMessage {
|
|
49
|
+
kind: 'updateTrackId';
|
|
50
|
+
data: {
|
|
51
|
+
oldTrackId: string;
|
|
52
|
+
newTrackId: string;
|
|
53
|
+
hasPacketTrailer: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export type PTWorkerMessage = PTInitMessage | PTInitAck | PTDecodeMessage | PTEncodeMessage | PTUpdateTrackIdMessage | PTMetadataMessage;
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PacketTrailerFeature } from '@livekit/protocol';
|
|
2
|
+
import type { PacketTrailerOptions } from './PacketTrailerManager';
|
|
3
|
+
import type { PacketTrailerPublishOptions } from './types';
|
|
4
|
+
export declare function shouldUsePacketTrailerScriptTransform(): boolean;
|
|
5
|
+
export declare function isPacketTrailerSupported(options?: PacketTrailerOptions): boolean;
|
|
6
|
+
export declare function hasPacketTrailerPublishOptions(options?: PacketTrailerPublishOptions): boolean;
|
|
7
|
+
export declare function getPacketTrailerFeatures(options?: PacketTrailerPublishOptions): PacketTrailerFeature[];
|
|
8
|
+
export declare function getPacketTrailerPublishOptions(features?: PacketTrailerFeature[]): PacketTrailerPublishOptions | undefined;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -130,6 +130,7 @@ export default class RTCEngine extends RTCEngine_base {
|
|
|
130
130
|
private handleBufferedAmountLow;
|
|
131
131
|
createSender(track: LocalTrack, opts: TrackPublishOptions, encodings?: RTCRtpEncodingParameters[]): Promise<RTCRtpSender>;
|
|
132
132
|
createSimulcastSender(track: LocalVideoTrack, simulcastTrack: SimulcastTrackInfo, opts: TrackPublishOptions, encodings?: RTCRtpEncodingParameters[]): Promise<RTCRtpSender | undefined>;
|
|
133
|
+
private setupPacketTrailerSender;
|
|
133
134
|
private createTransceiverRTCRtpSender;
|
|
134
135
|
private createSimulcastTransceiverSender;
|
|
135
136
|
private createRTCRtpSender;
|
|
@@ -146,7 +147,7 @@ export default class RTCEngine extends RTCEngine_base {
|
|
|
146
147
|
/** @internal */
|
|
147
148
|
publishRpcAck(destinationIdentity: string, requestId: string): Promise<void>;
|
|
148
149
|
sendDataPacket(packet: DataPacket, kind: DataChannelKind): Promise<void>;
|
|
149
|
-
sendLossyBytes(bytes:
|
|
150
|
+
sendLossyBytes(bytes: NonSharedUint8Array, kind: Exclude<DataChannelKind, DataChannelKind.RELIABLE>, bufferStatusLowBehavior?: 'drop' | 'wait'): Promise<void>;
|
|
150
151
|
private resendReliableMessagesForResume;
|
|
151
152
|
private updateAndEmitDCBufferStatus;
|
|
152
153
|
private isBufferStatusLow;
|
|
@@ -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?;
|
|
@@ -133,6 +134,7 @@ declare class Room extends Room_base {
|
|
|
133
134
|
*/
|
|
134
135
|
setE2EEEnabled(enabled: boolean): Promise<void>;
|
|
135
136
|
private setupE2EE;
|
|
137
|
+
private setupPacketTrailer;
|
|
136
138
|
private get logContext();
|
|
137
139
|
/**
|
|
138
140
|
* if the current room has a participant with `recorder: true` in its JWT grant
|
|
@@ -319,7 +321,7 @@ export type RoomEventCallbacks = {
|
|
|
319
321
|
participantAttributesChanged: (changedAttributes: Record<string, string>, participant: RemoteParticipant | LocalParticipant) => void;
|
|
320
322
|
activeSpeakersChanged: (speakers: Array<Participant>) => void;
|
|
321
323
|
roomMetadataChanged: (metadata: string) => void;
|
|
322
|
-
dataReceived: (payload:
|
|
324
|
+
dataReceived: (payload: NonSharedUint8Array, participant?: RemoteParticipant, kind?: DataPacket_Kind, topic?: string, encryptionType?: Encryption_Type) => void;
|
|
323
325
|
sipDTMFReceived: (dtmf: SipDTMF, participant?: RemoteParticipant) => void;
|
|
324
326
|
transcriptionReceived: (transcription: TranscriptionSegment[], participant?: Participant, publication?: TrackPublication) => void;
|
|
325
327
|
connectionQualityChanged: (quality: ConnectionQuality, participant: Participant) => void;
|
|
@@ -18,10 +18,11 @@ export default class LocalDataTrack implements ILocalTrack, IDataTrack {
|
|
|
18
18
|
protected log: StructuredLogger;
|
|
19
19
|
/** Resolves once the data track has sent all pending packets the rtc data channel buffer. */
|
|
20
20
|
protected flushedFuture: Future<void, never>;
|
|
21
|
+
protected isFlushed: boolean;
|
|
21
22
|
/** @internal */
|
|
22
23
|
constructor(options: DataTrackOptions, manager: OutgoingDataTrackManager);
|
|
23
24
|
private handleManagerReset;
|
|
24
|
-
private
|
|
25
|
+
private handleManagerPacketsFlushedChange;
|
|
25
26
|
/** @internal */
|
|
26
27
|
static withExplicitHandle(options: DataTrackOptions, manager: OutgoingDataTrackManager, handle: DataTrackHandle): LocalDataTrack;
|
|
27
28
|
/** Metrics about the data track publication. */
|
|
@@ -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.
|
|
@@ -7,7 +7,7 @@ import { DataTrackHandle } from '../handle';
|
|
|
7
7
|
import type { DataTrackInfo } from '../types';
|
|
8
8
|
import { DataTrackPublishError, DataTrackPushFrameError, DataTrackPushFrameErrorReason } from './errors';
|
|
9
9
|
import DataTrackOutgoingPipeline from './pipeline';
|
|
10
|
-
import type { DataTrackOptions, EventPacketAvailable,
|
|
10
|
+
import type { DataTrackOptions, EventPacketAvailable, EventPacketsFlushedChange, EventSfuPublishRequest, EventSfuUnpublishRequest, EventTrackPublished, EventTrackUnpublished, SfuPublishResponseResult } from './types';
|
|
11
11
|
export type PendingDescriptor = {
|
|
12
12
|
type: 'pending';
|
|
13
13
|
/** Resolves when the descriptor is fully published. */
|
|
@@ -38,7 +38,7 @@ export type DataTrackOutgoingManagerCallbacks = {
|
|
|
38
38
|
/** A {@link LocalDataTrack} has been unpublished */
|
|
39
39
|
trackUnpublished: (event: EventTrackUnpublished) => void;
|
|
40
40
|
/** A {@link LocalDataTrack} has had all of its in flight packets sent via the rtc data channel. */
|
|
41
|
-
|
|
41
|
+
packetsFlushedChange: (event: EventPacketsFlushedChange) => void;
|
|
42
42
|
/** The manager has been reset and all state has been cleared in preparation for the next room
|
|
43
43
|
* connection. */
|
|
44
44
|
reset: () => void;
|
|
@@ -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. */
|
|
@@ -40,7 +40,8 @@ export type EventTrackUnpublished = {
|
|
|
40
40
|
sid: DataTrackSid;
|
|
41
41
|
};
|
|
42
42
|
/** A track has had all of its in flight packets sent via the rtc data channel. */
|
|
43
|
-
export type
|
|
43
|
+
export type EventPacketsFlushedChange = {
|
|
44
44
|
handle: DataTrackHandle;
|
|
45
|
+
isFlushed: boolean;
|
|
45
46
|
};
|
|
46
47
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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
|
/**
|