livekit-client 2.22.3 → 2.23.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/README.md +35 -0
- 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 +71 -8
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +1746 -547
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.fm.worker.js +1 -1
- package/dist/livekit-client.fm.worker.js.map +1 -1
- package/dist/livekit-client.fm.worker.mjs +2 -1
- package/dist/livekit-client.fm.worker.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +4 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/api/WebSocketStream.d.ts +1 -0
- package/dist/src/api/WebSocketStream.d.ts.map +1 -1
- package/dist/src/api/utils.d.ts +1 -1
- package/dist/src/api/utils.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/naluUtils.d.ts +12 -1
- package/dist/src/e2ee/worker/naluUtils.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/options.d.ts +14 -0
- package/dist/src/options.d.ts.map +1 -1
- package/dist/src/room/DefaultReconnectPolicy.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +100 -7
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +16 -0
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +54 -1
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/data-channel/DataChannelManager.d.ts +9 -8
- package/dist/src/room/data-channel/DataChannelManager.d.ts.map +1 -1
- package/dist/src/room/data-channel/FlowControlledDataChannel.d.ts +25 -12
- package/dist/src/room/data-channel/FlowControlledDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-channel/LossyDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-channel/ReliableDataChannel.d.ts.map +1 -1
- package/dist/src/room/data-stream/incoming/IncomingDataStreamManager.d.ts.map +1 -1
- package/dist/src/room/defaults.d.ts.map +1 -1
- package/dist/src/room/errors.d.ts +18 -0
- package/dist/src/room/errors.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +3 -2
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +4 -0
- 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/publishUtils.d.ts.map +1 -1
- package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -1
- package/dist/src/room/rpc/utils.d.ts.map +1 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts +24 -1
- package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +18 -0
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +9 -0
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteAudioTrack.d.ts +6 -0
- package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
- package/dist/src/room/track/processor/types.d.ts +11 -0
- package/dist/src/room/track/processor/types.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +13 -0
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +60 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/compressionStreamStubs.d.ts +12 -0
- package/dist/src/test/compressionStreamStubs.d.ts.map +1 -0
- package/dist/ts4.2/api/SignalClient.d.ts +187 -185
- package/dist/ts4.2/api/SignalClientStateMachine.d.ts +85 -85
- package/dist/ts4.2/api/WebSocketStream.d.ts +34 -33
- package/dist/ts4.2/api/utils.d.ts +9 -9
- package/dist/ts4.2/connectionHelper/ConnectionCheck.d.ts +30 -30
- package/dist/ts4.2/connectionHelper/checks/Checker.d.ts +62 -62
- package/dist/ts4.2/connectionHelper/checks/cloudRegion.d.ts +18 -18
- package/dist/ts4.2/connectionHelper/checks/connectionProtocol.d.ts +20 -20
- package/dist/ts4.2/connectionHelper/checks/publishAudio.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/publishVideo.d.ts +7 -7
- package/dist/ts4.2/connectionHelper/checks/reconnect.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/turn.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/webrtc.d.ts +6 -6
- package/dist/ts4.2/connectionHelper/checks/websocket.d.ts +6 -6
- package/dist/ts4.2/e2ee/E2eeManager.d.ts +111 -111
- package/dist/ts4.2/e2ee/KeyProvider.d.ts +54 -54
- package/dist/ts4.2/e2ee/constants.d.ts +21 -21
- package/dist/ts4.2/e2ee/errors.d.ts +12 -12
- package/dist/ts4.2/e2ee/events.d.ts +39 -39
- package/dist/ts4.2/e2ee/index.d.ts +6 -6
- package/dist/ts4.2/e2ee/types.d.ts +231 -231
- package/dist/ts4.2/e2ee/utils.d.ts +32 -32
- package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +16 -16
- package/dist/ts4.2/e2ee/worker/ErrorRateLimiter.d.ts +21 -21
- package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +209 -209
- package/dist/ts4.2/e2ee/worker/ParticipantKeyHandler.d.ts +81 -84
- package/dist/ts4.2/e2ee/worker/e2ee.worker.d.ts +2 -2
- package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +39 -28
- package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +23 -23
- package/dist/ts4.2/frameMetadata/FrameMetadataManager.d.ts +53 -53
- package/dist/ts4.2/frameMetadata/frameMetadata.d.ts +33 -33
- package/dist/ts4.2/frameMetadata/types.d.ts +62 -62
- package/dist/ts4.2/frameMetadata/utils.d.ts +9 -9
- package/dist/ts4.2/frameMetadata/worker/frameMetadata.worker.d.ts +2 -2
- package/dist/ts4.2/index.d.ts +76 -76
- package/dist/ts4.2/logger.d.ts +66 -66
- package/dist/ts4.2/options.d.ts +163 -149
- package/dist/ts4.2/room/BackOffStrategy.d.ts +27 -27
- package/dist/ts4.2/room/DefaultReconnectPolicy.d.ts +8 -8
- package/dist/ts4.2/room/DeviceManager.d.ts +12 -12
- package/dist/ts4.2/room/PCTransport.d.ts +268 -175
- package/dist/ts4.2/room/PCTransportManager.d.ts +77 -77
- package/dist/ts4.2/room/RTCEngine.d.ts +277 -262
- package/dist/ts4.2/room/ReconnectPolicy.d.ts +24 -24
- package/dist/ts4.2/room/RegionUrlProvider.d.ts +36 -36
- package/dist/ts4.2/room/Room.d.ts +407 -365
- package/dist/ts4.2/room/attribute-typings.d.ts +35 -35
- package/dist/ts4.2/room/data-channel/DataChannelManager.d.ts +63 -62
- package/dist/ts4.2/room/data-channel/FlowControlledDataChannel.d.ts +107 -95
- package/dist/ts4.2/room/data-channel/LossyDataChannel.d.ts +41 -41
- package/dist/ts4.2/room/data-channel/ReliableDataChannel.d.ts +57 -57
- package/dist/ts4.2/room/data-channel/types.d.ts +12 -12
- package/dist/ts4.2/room/data-stream/compression.d.ts +49 -49
- package/dist/ts4.2/room/data-stream/constants.d.ts +18 -18
- package/dist/ts4.2/room/data-stream/incoming/IncomingDataStreamManager.d.ts +29 -29
- package/dist/ts4.2/room/data-stream/incoming/StreamReader.d.ts +80 -80
- package/dist/ts4.2/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts +73 -73
- package/dist/ts4.2/room/data-stream/outgoing/StreamWriter.d.ts +16 -16
- package/dist/ts4.2/room/data-stream/outgoing/header-utils.d.ts +18 -18
- package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +79 -80
- package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +50 -50
- package/dist/ts4.2/room/data-track/depacketizer.d.ts +59 -59
- package/dist/ts4.2/room/data-track/frame.d.ts +22 -22
- package/dist/ts4.2/room/data-track/handle.d.ts +27 -27
- package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +124 -124
- package/dist/ts4.2/room/data-track/incoming/errors.d.ts +24 -24
- package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +41 -41
- package/dist/ts4.2/room/data-track/incoming/types.d.ts +20 -20
- package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +126 -126
- package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +74 -74
- package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +23 -23
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +48 -48
- package/dist/ts4.2/room/data-track/packet/constants.d.ts +20 -20
- package/dist/ts4.2/room/data-track/packet/errors.d.ts +40 -40
- package/dist/ts4.2/room/data-track/packet/extensions.d.ts +69 -69
- package/dist/ts4.2/room/data-track/packet/index.d.ts +98 -98
- package/dist/ts4.2/room/data-track/packet/serializable.d.ts +13 -13
- package/dist/ts4.2/room/data-track/packetizer.d.ts +43 -43
- package/dist/ts4.2/room/data-track/track-interfaces.d.ts +23 -23
- package/dist/ts4.2/room/data-track/types.d.ts +22 -22
- package/dist/ts4.2/room/data-track/utils.d.ts +60 -60
- package/dist/ts4.2/room/debounce.d.ts +11 -11
- package/dist/ts4.2/room/defaults.d.ts +9 -9
- package/dist/ts4.2/room/errors.d.ts +180 -162
- package/dist/ts4.2/room/events.d.ts +638 -637
- package/dist/ts4.2/room/participant/LocalParticipant.d.ts +291 -287
- package/dist/ts4.2/room/participant/Participant.d.ts +142 -144
- package/dist/ts4.2/room/participant/ParticipantTrackPermission.d.ts +26 -26
- package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +85 -86
- package/dist/ts4.2/room/participant/publishUtils.d.ts +53 -53
- package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -43
- package/dist/ts4.2/room/rpc/client/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/index.d.ts +7 -7
- package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -44
- package/dist/ts4.2/room/rpc/server/events.d.ts +8 -8
- package/dist/ts4.2/room/rpc/utils.d.ts +131 -131
- package/dist/ts4.2/room/stats.d.ts +71 -71
- package/dist/ts4.2/room/statsSummary.d.ts +13 -13
- package/dist/ts4.2/room/timers.d.ts +12 -12
- package/dist/ts4.2/room/token-source/TokenSource.d.ts +82 -82
- package/dist/ts4.2/room/token-source/types.d.ts +70 -70
- package/dist/ts4.2/room/token-source/utils.d.ts +8 -8
- package/dist/ts4.2/room/track/FrameMetadataExtractor.d.ts +19 -19
- package/dist/ts4.2/room/track/LocalAudioTrack.d.ts +62 -42
- package/dist/ts4.2/room/track/LocalTrack.d.ts +143 -125
- package/dist/ts4.2/room/track/LocalTrackPublication.d.ts +42 -42
- package/dist/ts4.2/room/track/LocalVideoTrack.d.ts +109 -100
- package/dist/ts4.2/room/track/RemoteAudioTrack.d.ts +61 -55
- package/dist/ts4.2/room/track/RemoteTrack.d.ts +38 -38
- package/dist/ts4.2/room/track/RemoteTrackPublication.d.ts +72 -75
- package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +73 -76
- package/dist/ts4.2/room/track/Track.d.ts +156 -166
- package/dist/ts4.2/room/track/TrackPublication.d.ts +75 -81
- package/dist/ts4.2/room/track/create.d.ts +25 -25
- package/dist/ts4.2/room/track/facingMode.d.ts +41 -41
- package/dist/ts4.2/room/track/options.d.ts +403 -403
- package/dist/ts4.2/room/track/processor/types.d.ts +42 -31
- package/dist/ts4.2/room/track/record.d.ts +13 -13
- package/dist/ts4.2/room/track/types.d.ts +28 -28
- package/dist/ts4.2/room/track/utils.d.ts +60 -47
- package/dist/ts4.2/room/types.d.ts +127 -127
- package/dist/ts4.2/room/utils.d.ts +273 -214
- package/dist/ts4.2/test/MockMediaStreamTrack.d.ts +26 -26
- package/dist/ts4.2/test/compressionStreamStubs.d.ts +12 -0
- package/dist/ts4.2/test/mocks.d.ts +12 -12
- package/dist/ts4.2/test/promiseState.d.ts +12 -12
- package/dist/ts4.2/test/signalToken.d.ts +26 -26
- package/dist/ts4.2/type-polyfills/non-shared-typed-arrays.d.ts +2 -2
- package/dist/ts4.2/utils/AsyncQueue.d.ts +23 -23
- package/dist/ts4.2/utils/TypedPromise.d.ts +17 -17
- package/dist/ts4.2/utils/abort-signal-polyfill.d.ts +13 -13
- package/dist/ts4.2/utils/browserParser.d.ts +13 -13
- package/dist/ts4.2/utils/camelToSnakeCase.d.ts +8 -8
- package/dist/ts4.2/utils/cloneDeep.d.ts +2 -2
- package/dist/ts4.2/utils/dataPacketBuffer.d.ts +34 -34
- package/dist/ts4.2/utils/deferrable-map.d.ts +32 -32
- package/dist/ts4.2/utils/machineInspector.d.ts +54 -54
- package/dist/ts4.2/utils/serializer.d.ts +48 -48
- package/dist/ts4.2/utils/subscribeToEvents.d.ts +15 -15
- package/dist/ts4.2/utils/ttlmap.d.ts +20 -20
- package/dist/ts4.2/version.d.ts +15 -15
- package/package.json +5 -4
- package/src/api/SignalClient.e2e.test.ts +1 -3
- package/src/api/SignalClient.test.ts +394 -10
- package/src/api/SignalClient.ts +132 -76
- package/src/api/WebSocketStream.test.ts +11 -0
- package/src/api/WebSocketStream.ts +22 -1
- package/src/api/utils.ts +1 -1
- package/src/e2ee/E2eeManager.test.ts +43 -0
- package/src/e2ee/E2eeManager.ts +6 -2
- package/src/e2ee/worker/FrameCryptor.test.ts +212 -90
- package/src/e2ee/worker/FrameCryptor.ts +21 -4
- package/src/e2ee/worker/naluUtils.test.ts +123 -0
- package/src/e2ee/worker/naluUtils.ts +57 -2
- package/src/index.ts +2 -0
- package/src/options.ts +16 -0
- package/src/room/DefaultReconnectPolicy.test.ts +58 -0
- package/src/room/DefaultReconnectPolicy.ts +14 -2
- package/src/room/PCTransport.test.ts +327 -9
- package/src/room/PCTransport.ts +339 -36
- package/src/room/PCTransportManager.ts +3 -1
- package/src/room/RTCEngine.test.ts +318 -2
- package/src/room/RTCEngine.ts +126 -12
- package/src/room/Room.test.ts +148 -6
- package/src/room/Room.ts +312 -80
- package/src/room/data-channel/DataChannelManager.test.ts +24 -7
- package/src/room/data-channel/DataChannelManager.ts +43 -38
- package/src/room/data-channel/FlowControlledDataChannel.test.ts +60 -18
- package/src/room/data-channel/FlowControlledDataChannel.ts +40 -22
- package/src/room/data-channel/LossyDataChannel.test.ts +38 -0
- package/src/room/data-channel/LossyDataChannel.ts +10 -1
- package/src/room/data-channel/ReliableDataChannel.test.ts +72 -0
- package/src/room/data-channel/ReliableDataChannel.ts +16 -5
- package/src/room/data-stream/incoming/IncomingDataStreamManager.test.ts +47 -20
- package/src/room/data-stream/incoming/IncomingDataStreamManager.ts +16 -5
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.test.ts +60 -39
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +4 -4
- package/src/room/defaults.ts +1 -0
- package/src/room/errors.test.ts +36 -0
- package/src/room/errors.ts +27 -0
- package/src/room/events.ts +2 -1
- package/src/room/participant/LocalParticipant.test.ts +136 -1
- package/src/room/participant/LocalParticipant.ts +66 -17
- package/src/room/participant/Participant.ts +6 -3
- package/src/room/participant/publishUtils.ts +0 -19
- package/src/room/participant/restartOnDefaultAudioDevice.test.ts +177 -0
- package/src/room/rpc/client/RpcClientManager.test.ts +51 -0
- package/src/room/rpc/client/RpcClientManager.ts +32 -15
- package/src/room/rpc/utils.test.ts +32 -0
- package/src/room/rpc/utils.ts +7 -0
- package/src/room/track/LocalAudioTrack.ts +101 -10
- package/src/room/track/LocalTrack.ts +87 -19
- package/src/room/track/LocalVideoTrack.ts +17 -3
- package/src/room/track/RemoteAudioTrack.ts +59 -14
- package/src/room/track/RemoteVideoTrack.test.ts +210 -0
- package/src/room/track/RemoteVideoTrack.ts +29 -3
- package/src/room/track/processor/types.ts +11 -0
- package/src/room/track/utils.test.ts +206 -2
- package/src/room/track/utils.ts +117 -5
- package/src/room/utils.test.ts +250 -0
- package/src/room/utils.ts +152 -19
- package/src/test/compressionStreamStubs.ts +53 -0
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
-
import type TypedEmitter from 'typed-emitter';
|
|
3
|
-
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
4
|
-
import { Future } from '../../utils';
|
|
5
|
-
import type { DataTrackFrameInternal } from '../frame';
|
|
6
|
-
import { DataTrackHandle } from '../handle';
|
|
7
|
-
import type { DataTrackInfo } from '../types';
|
|
8
|
-
import { DataTrackPublishError, DataTrackPushFrameError, DataTrackPushFrameErrorReason } from './errors';
|
|
9
|
-
import DataTrackOutgoingPipeline from './pipeline';
|
|
10
|
-
import type { DataTrackOptions, EventPacketAvailable, EventPacketsFlushedChange, EventSfuPublishRequest, EventSfuUnpublishRequest, EventTrackPublished, EventTrackUnpublished, SfuPublishResponseResult } from './types';
|
|
11
|
-
export type PendingDescriptor = {
|
|
12
|
-
type: 'pending';
|
|
13
|
-
/** Resolves when the descriptor is fully published. */
|
|
14
|
-
completionFuture: Future<void, DataTrackPublishError>;
|
|
15
|
-
};
|
|
16
|
-
export type ActiveDescriptor = {
|
|
17
|
-
type: 'active';
|
|
18
|
-
info: DataTrackInfo;
|
|
19
|
-
publishState: 'published' | 'republishing' | 'unpublished';
|
|
20
|
-
pipeline: DataTrackOutgoingPipeline;
|
|
21
|
-
/** Resolves when the descriptor is unpublished. */
|
|
22
|
-
unpublishingFuture: Future<void, never>;
|
|
23
|
-
};
|
|
24
|
-
export type Descriptor = PendingDescriptor | ActiveDescriptor;
|
|
25
|
-
export declare const Descriptor: {
|
|
26
|
-
pending(): PendingDescriptor;
|
|
27
|
-
active(info: DataTrackInfo, e2eeManager: BaseE2EEManager | null): ActiveDescriptor;
|
|
28
|
-
};
|
|
29
|
-
export type DataTrackOutgoingManagerCallbacks = {
|
|
30
|
-
/** Request sent to the SFU to publish a track. */
|
|
31
|
-
sfuPublishRequest: (event: EventSfuPublishRequest) => void;
|
|
32
|
-
/** Request sent to the SFU to unpublish a track. */
|
|
33
|
-
sfuUnpublishRequest: (event: EventSfuUnpublishRequest) => void;
|
|
34
|
-
/** A serialized packet is ready to be sent over the transport. */
|
|
35
|
-
packetAvailable: (event: EventPacketAvailable) => void;
|
|
36
|
-
/** A new {@link LocalDataTrack} has been published */
|
|
37
|
-
trackPublished: (event: EventTrackPublished) => void;
|
|
38
|
-
/** A {@link LocalDataTrack} has been unpublished */
|
|
39
|
-
trackUnpublished: (event: EventTrackUnpublished) => void;
|
|
40
|
-
/** A {@link LocalDataTrack} has had all of its in flight packets sent via the rtc data channel. */
|
|
41
|
-
packetsFlushedChange: (event: EventPacketsFlushedChange) => void;
|
|
42
|
-
/** The manager has been reset and all state has been cleared in preparation for the next room
|
|
43
|
-
* connection. */
|
|
44
|
-
reset: () => void;
|
|
45
|
-
};
|
|
46
|
-
type OutgoingDataTrackManagerOptions = {
|
|
47
|
-
/**
|
|
48
|
-
* Provider to use for encrypting outgoing frame payloads.
|
|
49
|
-
*
|
|
50
|
-
* If null, end-to-end encryption will be disabled for all published tracks.
|
|
51
|
-
*/
|
|
52
|
-
e2eeManager?: BaseE2EEManager;
|
|
53
|
-
};
|
|
54
|
-
declare const OutgoingDataTrackManager_base: new () => TypedEmitter<DataTrackOutgoingManagerCallbacks>;
|
|
55
|
-
export default class OutgoingDataTrackManager extends OutgoingDataTrackManager_base {
|
|
56
|
-
private e2eeManager;
|
|
57
|
-
private handleAllocator;
|
|
58
|
-
private descriptors;
|
|
59
|
-
/** Number of packets for each data track which have been emitted via the `packetAvailable` event
|
|
60
|
-
* and which have not yet been sent via the rtc data channel yet. Once this goes to 0, then
|
|
61
|
-
* all in flight packets have been delivered, and the data tracks is "flushed". */
|
|
62
|
-
private inFlightPacketCounter;
|
|
63
|
-
constructor(options?: OutgoingDataTrackManagerOptions);
|
|
64
|
-
static withDescriptors(descriptors: Map<DataTrackHandle, Descriptor>): OutgoingDataTrackManager;
|
|
65
|
-
/** @internal */
|
|
66
|
-
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
67
|
-
/**
|
|
68
|
-
* Used by attached {@link LocalDataTrack} instances to query their associated descriptor info.
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
getDescriptor(handle: DataTrackHandle): Descriptor | null;
|
|
72
|
-
/** Used by attached {@link LocalDataTrack} instances to broadcast data track packets to other
|
|
73
|
-
* subscribers.
|
|
74
|
-
* @internal
|
|
75
|
-
*/
|
|
76
|
-
tryProcessAndSend(handle: DataTrackHandle, frame: DataTrackFrameInternal): Promise<Throws<void, DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped> | DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>>>;
|
|
77
|
-
/** The client has sent a packet over the rtc data channel. This signal is used for determining
|
|
78
|
-
* once all packets are sent and a data track has been "flushed".
|
|
79
|
-
*
|
|
80
|
-
* @internal */
|
|
81
|
-
handlePacketSendComplete(handle: DataTrackHandle): void;
|
|
82
|
-
/**
|
|
83
|
-
* Client requested to publish a track.
|
|
84
|
-
*
|
|
85
|
-
* If the LiveKit server is too old and doesn't support data tracks, a
|
|
86
|
-
* {@link DataTrackPublishError#timeout} will be thrown.
|
|
87
|
-
*
|
|
88
|
-
* @internal
|
|
89
|
-
**/
|
|
90
|
-
publishRequest(options: DataTrackOptions, signal?: AbortSignal): Promise<Throws<DataTrackHandle, DataTrackPublishError>>;
|
|
91
|
-
/**
|
|
92
|
-
* Get information about all currently published tracks.
|
|
93
|
-
* @internal
|
|
94
|
-
**/
|
|
95
|
-
queryPublished(): DataTrackInfo[];
|
|
96
|
-
/**
|
|
97
|
-
* Client request to unpublish a track.
|
|
98
|
-
* @internal
|
|
99
|
-
**/
|
|
100
|
-
unpublishRequest(handle: DataTrackHandle): Promise<void>;
|
|
101
|
-
/**
|
|
102
|
-
* SFU responded to a request to publish a data track.
|
|
103
|
-
* @internal
|
|
104
|
-
**/
|
|
105
|
-
receivedSfuPublishResponse(handle: DataTrackHandle, result: SfuPublishResponseResult): void;
|
|
106
|
-
/**
|
|
107
|
-
* SFU notification that a track has been unpublished.
|
|
108
|
-
* @internal
|
|
109
|
-
**/
|
|
110
|
-
receivedSfuUnpublishResponse(handle: DataTrackHandle): void;
|
|
111
|
-
/** Republish all tracks.
|
|
112
|
-
*
|
|
113
|
-
* This must be sent after a full reconnect in order for existing publications
|
|
114
|
-
* to be recognized by the SFU. Each republished track will be assigned a new SID.
|
|
115
|
-
* @internal
|
|
116
|
-
*/
|
|
117
|
-
sfuWillRepublishTracks(): void;
|
|
118
|
-
/**
|
|
119
|
-
* Reset's the state of the manager and all associated tracks. Run on room disconnect to get
|
|
120
|
-
* the manager ready for the next room connection.
|
|
121
|
-
* @internal
|
|
122
|
-
**/
|
|
123
|
-
reset(): Promise<void>;
|
|
124
|
-
}
|
|
125
|
-
export {};
|
|
126
|
-
//# sourceMappingURL=OutgoingDataTrackManager.d.ts.map
|
|
1
|
+
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
+
import type TypedEmitter from 'typed-emitter';
|
|
3
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
4
|
+
import { Future } from '../../utils';
|
|
5
|
+
import type { DataTrackFrameInternal } from '../frame';
|
|
6
|
+
import { DataTrackHandle } from '../handle';
|
|
7
|
+
import type { DataTrackInfo } from '../types';
|
|
8
|
+
import { DataTrackPublishError, DataTrackPushFrameError, DataTrackPushFrameErrorReason } from './errors';
|
|
9
|
+
import DataTrackOutgoingPipeline from './pipeline';
|
|
10
|
+
import type { DataTrackOptions, EventPacketAvailable, EventPacketsFlushedChange, EventSfuPublishRequest, EventSfuUnpublishRequest, EventTrackPublished, EventTrackUnpublished, SfuPublishResponseResult } from './types';
|
|
11
|
+
export type PendingDescriptor = {
|
|
12
|
+
type: 'pending';
|
|
13
|
+
/** Resolves when the descriptor is fully published. */
|
|
14
|
+
completionFuture: Future<void, DataTrackPublishError>;
|
|
15
|
+
};
|
|
16
|
+
export type ActiveDescriptor = {
|
|
17
|
+
type: 'active';
|
|
18
|
+
info: DataTrackInfo;
|
|
19
|
+
publishState: 'published' | 'republishing' | 'unpublished';
|
|
20
|
+
pipeline: DataTrackOutgoingPipeline;
|
|
21
|
+
/** Resolves when the descriptor is unpublished. */
|
|
22
|
+
unpublishingFuture: Future<void, never>;
|
|
23
|
+
};
|
|
24
|
+
export type Descriptor = PendingDescriptor | ActiveDescriptor;
|
|
25
|
+
export declare const Descriptor: {
|
|
26
|
+
pending(): PendingDescriptor;
|
|
27
|
+
active(info: DataTrackInfo, e2eeManager: BaseE2EEManager | null): ActiveDescriptor;
|
|
28
|
+
};
|
|
29
|
+
export type DataTrackOutgoingManagerCallbacks = {
|
|
30
|
+
/** Request sent to the SFU to publish a track. */
|
|
31
|
+
sfuPublishRequest: (event: EventSfuPublishRequest) => void;
|
|
32
|
+
/** Request sent to the SFU to unpublish a track. */
|
|
33
|
+
sfuUnpublishRequest: (event: EventSfuUnpublishRequest) => void;
|
|
34
|
+
/** A serialized packet is ready to be sent over the transport. */
|
|
35
|
+
packetAvailable: (event: EventPacketAvailable) => void;
|
|
36
|
+
/** A new {@link LocalDataTrack} has been published */
|
|
37
|
+
trackPublished: (event: EventTrackPublished) => void;
|
|
38
|
+
/** A {@link LocalDataTrack} has been unpublished */
|
|
39
|
+
trackUnpublished: (event: EventTrackUnpublished) => void;
|
|
40
|
+
/** A {@link LocalDataTrack} has had all of its in flight packets sent via the rtc data channel. */
|
|
41
|
+
packetsFlushedChange: (event: EventPacketsFlushedChange) => void;
|
|
42
|
+
/** The manager has been reset and all state has been cleared in preparation for the next room
|
|
43
|
+
* connection. */
|
|
44
|
+
reset: () => void;
|
|
45
|
+
};
|
|
46
|
+
type OutgoingDataTrackManagerOptions = {
|
|
47
|
+
/**
|
|
48
|
+
* Provider to use for encrypting outgoing frame payloads.
|
|
49
|
+
*
|
|
50
|
+
* If null, end-to-end encryption will be disabled for all published tracks.
|
|
51
|
+
*/
|
|
52
|
+
e2eeManager?: BaseE2EEManager;
|
|
53
|
+
};
|
|
54
|
+
declare const OutgoingDataTrackManager_base: new () => TypedEmitter<DataTrackOutgoingManagerCallbacks>;
|
|
55
|
+
export default class OutgoingDataTrackManager extends OutgoingDataTrackManager_base {
|
|
56
|
+
private e2eeManager;
|
|
57
|
+
private handleAllocator;
|
|
58
|
+
private descriptors;
|
|
59
|
+
/** Number of packets for each data track which have been emitted via the `packetAvailable` event
|
|
60
|
+
* and which have not yet been sent via the rtc data channel yet. Once this goes to 0, then
|
|
61
|
+
* all in flight packets have been delivered, and the data tracks is "flushed". */
|
|
62
|
+
private inFlightPacketCounter;
|
|
63
|
+
constructor(options?: OutgoingDataTrackManagerOptions);
|
|
64
|
+
static withDescriptors(descriptors: Map<DataTrackHandle, Descriptor>): OutgoingDataTrackManager;
|
|
65
|
+
/** @internal */
|
|
66
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
67
|
+
/**
|
|
68
|
+
* Used by attached {@link LocalDataTrack} instances to query their associated descriptor info.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
getDescriptor(handle: DataTrackHandle): Descriptor | null;
|
|
72
|
+
/** Used by attached {@link LocalDataTrack} instances to broadcast data track packets to other
|
|
73
|
+
* subscribers.
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
tryProcessAndSend(handle: DataTrackHandle, frame: DataTrackFrameInternal): Promise<Throws<void, DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped> | DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>>>;
|
|
77
|
+
/** The client has sent a packet over the rtc data channel. This signal is used for determining
|
|
78
|
+
* once all packets are sent and a data track has been "flushed".
|
|
79
|
+
*
|
|
80
|
+
* @internal */
|
|
81
|
+
handlePacketSendComplete(handle: DataTrackHandle): void;
|
|
82
|
+
/**
|
|
83
|
+
* Client requested to publish a track.
|
|
84
|
+
*
|
|
85
|
+
* If the LiveKit server is too old and doesn't support data tracks, a
|
|
86
|
+
* {@link DataTrackPublishError#timeout} will be thrown.
|
|
87
|
+
*
|
|
88
|
+
* @internal
|
|
89
|
+
**/
|
|
90
|
+
publishRequest(options: DataTrackOptions, signal?: AbortSignal): Promise<Throws<DataTrackHandle, DataTrackPublishError>>;
|
|
91
|
+
/**
|
|
92
|
+
* Get information about all currently published tracks.
|
|
93
|
+
* @internal
|
|
94
|
+
**/
|
|
95
|
+
queryPublished(): DataTrackInfo[];
|
|
96
|
+
/**
|
|
97
|
+
* Client request to unpublish a track.
|
|
98
|
+
* @internal
|
|
99
|
+
**/
|
|
100
|
+
unpublishRequest(handle: DataTrackHandle): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* SFU responded to a request to publish a data track.
|
|
103
|
+
* @internal
|
|
104
|
+
**/
|
|
105
|
+
receivedSfuPublishResponse(handle: DataTrackHandle, result: SfuPublishResponseResult): void;
|
|
106
|
+
/**
|
|
107
|
+
* SFU notification that a track has been unpublished.
|
|
108
|
+
* @internal
|
|
109
|
+
**/
|
|
110
|
+
receivedSfuUnpublishResponse(handle: DataTrackHandle): void;
|
|
111
|
+
/** Republish all tracks.
|
|
112
|
+
*
|
|
113
|
+
* This must be sent after a full reconnect in order for existing publications
|
|
114
|
+
* to be recognized by the SFU. Each republished track will be assigned a new SID.
|
|
115
|
+
* @internal
|
|
116
|
+
*/
|
|
117
|
+
sfuWillRepublishTracks(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Reset's the state of the manager and all associated tracks. Run on room disconnect to get
|
|
120
|
+
* the manager ready for the next room connection.
|
|
121
|
+
* @internal
|
|
122
|
+
**/
|
|
123
|
+
reset(): Promise<void>;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=OutgoingDataTrackManager.d.ts.map
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { LivekitReasonedError } from '../../errors';
|
|
2
|
-
import { DataTrackPacketizerError } from '../packetizer';
|
|
3
|
-
export declare enum DataTrackPublishErrorReason {
|
|
4
|
-
/**
|
|
5
|
-
* Local participant does not have permission to publish data tracks.
|
|
6
|
-
*
|
|
7
|
-
* Ensure the participant's token contains the `canPublishData` grant.
|
|
8
|
-
*/
|
|
9
|
-
NotAllowed = 0,
|
|
10
|
-
/** A track with the same name is already published by the local participant. */
|
|
11
|
-
DuplicateName = 1,
|
|
12
|
-
/** Request to publish the track took long to complete. */
|
|
13
|
-
Timeout = 2,
|
|
14
|
-
/** No additional data tracks can be published by the local participant. */
|
|
15
|
-
LimitReached = 3,
|
|
16
|
-
/** Cannot publish data track when the room is disconnected. */
|
|
17
|
-
Disconnected = 4,
|
|
18
|
-
Cancelled = 5,
|
|
19
|
-
/** The name requested is not able to be used when creating the data track. */
|
|
20
|
-
InvalidName = 6,
|
|
21
|
-
/** There was an error publishing, but it was not something that could be sorted into a known
|
|
22
|
-
* category. */
|
|
23
|
-
Unknown = 7
|
|
24
|
-
}
|
|
25
|
-
export declare class DataTrackPublishError<Reason extends DataTrackPublishErrorReason = DataTrackPublishErrorReason> extends LivekitReasonedError<Reason> {
|
|
26
|
-
readonly name = "DataTrackPublishError";
|
|
27
|
-
reason: Reason;
|
|
28
|
-
reasonName: string;
|
|
29
|
-
/** Underling message from the SFU, if one was provided */
|
|
30
|
-
rawMessage?: string;
|
|
31
|
-
constructor(message: string, reason: Reason, options?: {
|
|
32
|
-
rawMessage?: string;
|
|
33
|
-
cause?: unknown;
|
|
34
|
-
});
|
|
35
|
-
static notAllowed(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed>;
|
|
36
|
-
static duplicateName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName>;
|
|
37
|
-
static invalidName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.InvalidName>;
|
|
38
|
-
static timeout(): DataTrackPublishError<DataTrackPublishErrorReason.Timeout>;
|
|
39
|
-
static limitReached(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
40
|
-
static unknown(reason: number, message: string): DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
41
|
-
static disconnected(): DataTrackPublishError<DataTrackPublishErrorReason.Disconnected>;
|
|
42
|
-
static cancelled(): DataTrackPublishError<DataTrackPublishErrorReason.Cancelled>;
|
|
43
|
-
}
|
|
44
|
-
export declare enum DataTrackPushFrameErrorReason {
|
|
45
|
-
/** Track is no longer published. */
|
|
46
|
-
TrackUnpublished = 0,
|
|
47
|
-
/** Frame was dropped. */
|
|
48
|
-
Dropped = 1
|
|
49
|
-
}
|
|
50
|
-
export declare class DataTrackPushFrameError<Reason extends DataTrackPushFrameErrorReason = DataTrackPushFrameErrorReason> extends LivekitReasonedError<Reason> {
|
|
51
|
-
readonly name = "DataTrackPushFrameError";
|
|
52
|
-
reason: Reason;
|
|
53
|
-
reasonName: string;
|
|
54
|
-
constructor(message: string, reason: Reason, options?: {
|
|
55
|
-
cause?: unknown;
|
|
56
|
-
});
|
|
57
|
-
static trackUnpublished(): DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>;
|
|
58
|
-
static dropped(cause?: unknown): DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped>;
|
|
59
|
-
}
|
|
60
|
-
export declare enum DataTrackOutgoingPipelineErrorReason {
|
|
61
|
-
Packetizer = 0,
|
|
62
|
-
Encryption = 1
|
|
63
|
-
}
|
|
64
|
-
export declare class DataTrackOutgoingPipelineError<Reason extends DataTrackOutgoingPipelineErrorReason = DataTrackOutgoingPipelineErrorReason> extends LivekitReasonedError<Reason> {
|
|
65
|
-
readonly name = "DataTrackOutgoingPipelineError";
|
|
66
|
-
reason: Reason;
|
|
67
|
-
reasonName: string;
|
|
68
|
-
constructor(message: string, reason: Reason, options?: {
|
|
69
|
-
cause?: unknown;
|
|
70
|
-
});
|
|
71
|
-
static packetizer(cause: DataTrackPacketizerError): DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Packetizer>;
|
|
72
|
-
static encryption(cause: unknown): DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Encryption>;
|
|
73
|
-
}
|
|
74
|
-
//# sourceMappingURL=errors.d.ts.map
|
|
1
|
+
import { LivekitReasonedError } from '../../errors';
|
|
2
|
+
import { DataTrackPacketizerError } from '../packetizer';
|
|
3
|
+
export declare enum DataTrackPublishErrorReason {
|
|
4
|
+
/**
|
|
5
|
+
* Local participant does not have permission to publish data tracks.
|
|
6
|
+
*
|
|
7
|
+
* Ensure the participant's token contains the `canPublishData` grant.
|
|
8
|
+
*/
|
|
9
|
+
NotAllowed = 0,
|
|
10
|
+
/** A track with the same name is already published by the local participant. */
|
|
11
|
+
DuplicateName = 1,
|
|
12
|
+
/** Request to publish the track took long to complete. */
|
|
13
|
+
Timeout = 2,
|
|
14
|
+
/** No additional data tracks can be published by the local participant. */
|
|
15
|
+
LimitReached = 3,
|
|
16
|
+
/** Cannot publish data track when the room is disconnected. */
|
|
17
|
+
Disconnected = 4,
|
|
18
|
+
Cancelled = 5,
|
|
19
|
+
/** The name requested is not able to be used when creating the data track. */
|
|
20
|
+
InvalidName = 6,
|
|
21
|
+
/** There was an error publishing, but it was not something that could be sorted into a known
|
|
22
|
+
* category. */
|
|
23
|
+
Unknown = 7
|
|
24
|
+
}
|
|
25
|
+
export declare class DataTrackPublishError<Reason extends DataTrackPublishErrorReason = DataTrackPublishErrorReason> extends LivekitReasonedError<Reason> {
|
|
26
|
+
readonly name = "DataTrackPublishError";
|
|
27
|
+
reason: Reason;
|
|
28
|
+
reasonName: string;
|
|
29
|
+
/** Underling message from the SFU, if one was provided */
|
|
30
|
+
rawMessage?: string;
|
|
31
|
+
constructor(message: string, reason: Reason, options?: {
|
|
32
|
+
rawMessage?: string;
|
|
33
|
+
cause?: unknown;
|
|
34
|
+
});
|
|
35
|
+
static notAllowed(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed>;
|
|
36
|
+
static duplicateName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName>;
|
|
37
|
+
static invalidName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.InvalidName>;
|
|
38
|
+
static timeout(): DataTrackPublishError<DataTrackPublishErrorReason.Timeout>;
|
|
39
|
+
static limitReached(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
40
|
+
static unknown(reason: number, message: string): DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
41
|
+
static disconnected(): DataTrackPublishError<DataTrackPublishErrorReason.Disconnected>;
|
|
42
|
+
static cancelled(): DataTrackPublishError<DataTrackPublishErrorReason.Cancelled>;
|
|
43
|
+
}
|
|
44
|
+
export declare enum DataTrackPushFrameErrorReason {
|
|
45
|
+
/** Track is no longer published. */
|
|
46
|
+
TrackUnpublished = 0,
|
|
47
|
+
/** Frame was dropped. */
|
|
48
|
+
Dropped = 1
|
|
49
|
+
}
|
|
50
|
+
export declare class DataTrackPushFrameError<Reason extends DataTrackPushFrameErrorReason = DataTrackPushFrameErrorReason> extends LivekitReasonedError<Reason> {
|
|
51
|
+
readonly name = "DataTrackPushFrameError";
|
|
52
|
+
reason: Reason;
|
|
53
|
+
reasonName: string;
|
|
54
|
+
constructor(message: string, reason: Reason, options?: {
|
|
55
|
+
cause?: unknown;
|
|
56
|
+
});
|
|
57
|
+
static trackUnpublished(): DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>;
|
|
58
|
+
static dropped(cause?: unknown): DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped>;
|
|
59
|
+
}
|
|
60
|
+
export declare enum DataTrackOutgoingPipelineErrorReason {
|
|
61
|
+
Packetizer = 0,
|
|
62
|
+
Encryption = 1
|
|
63
|
+
}
|
|
64
|
+
export declare class DataTrackOutgoingPipelineError<Reason extends DataTrackOutgoingPipelineErrorReason = DataTrackOutgoingPipelineErrorReason> extends LivekitReasonedError<Reason> {
|
|
65
|
+
readonly name = "DataTrackOutgoingPipelineError";
|
|
66
|
+
reason: Reason;
|
|
67
|
+
reasonName: string;
|
|
68
|
+
constructor(message: string, reason: Reason, options?: {
|
|
69
|
+
cause?: unknown;
|
|
70
|
+
});
|
|
71
|
+
static packetizer(cause: DataTrackPacketizerError): DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Packetizer>;
|
|
72
|
+
static encryption(cause: unknown): DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Encryption>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
-
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
3
|
-
import type { DataTrackFrameInternal } from '../frame';
|
|
4
|
-
import { DataTrackPacket } from '../packet';
|
|
5
|
-
import type { DataTrackInfo } from '../types';
|
|
6
|
-
import { DataTrackOutgoingPipelineError, DataTrackOutgoingPipelineErrorReason } from './errors';
|
|
7
|
-
type Options = {
|
|
8
|
-
info: DataTrackInfo;
|
|
9
|
-
e2eeManager: BaseE2EEManager | null;
|
|
10
|
-
};
|
|
11
|
-
/** Processes outgoing frames into final packets for distribution to the SFU. */
|
|
12
|
-
export default class DataTrackOutgoingPipeline {
|
|
13
|
-
private e2eeManager;
|
|
14
|
-
private packetizer;
|
|
15
|
-
/** Maximum transmission unit (MTU) of the transport. */
|
|
16
|
-
private static TRANSPORT_MTU_BYTES;
|
|
17
|
-
constructor(options: Options);
|
|
18
|
-
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
19
|
-
processFrame(frame: DataTrackFrameInternal): Throws<AsyncGenerator<DataTrackPacket>, DataTrackOutgoingPipelineError>;
|
|
20
|
-
encryptIfNeeded(frame: DataTrackFrameInternal): Promise<Throws<DataTrackFrameInternal, DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Encryption>>>;
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=pipeline.d.ts.map
|
|
1
|
+
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
3
|
+
import type { DataTrackFrameInternal } from '../frame';
|
|
4
|
+
import { DataTrackPacket } from '../packet';
|
|
5
|
+
import type { DataTrackInfo } from '../types';
|
|
6
|
+
import { DataTrackOutgoingPipelineError, DataTrackOutgoingPipelineErrorReason } from './errors';
|
|
7
|
+
type Options = {
|
|
8
|
+
info: DataTrackInfo;
|
|
9
|
+
e2eeManager: BaseE2EEManager | null;
|
|
10
|
+
};
|
|
11
|
+
/** Processes outgoing frames into final packets for distribution to the SFU. */
|
|
12
|
+
export default class DataTrackOutgoingPipeline {
|
|
13
|
+
private e2eeManager;
|
|
14
|
+
private packetizer;
|
|
15
|
+
/** Maximum transmission unit (MTU) of the transport. */
|
|
16
|
+
private static TRANSPORT_MTU_BYTES;
|
|
17
|
+
constructor(options: Options);
|
|
18
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
19
|
+
processFrame(frame: DataTrackFrameInternal): Throws<AsyncGenerator<DataTrackPacket>, DataTrackOutgoingPipelineError>;
|
|
20
|
+
encryptIfNeeded(frame: DataTrackFrameInternal): Promise<Throws<DataTrackFrameInternal, DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Encryption>>>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import type { NonSharedUint8Array } from '../../../type-polyfills/non-shared-typed-arrays';
|
|
2
|
-
import type LocalDataTrack from '../LocalDataTrack';
|
|
3
|
-
import type { DataTrackHandle } from '../handle';
|
|
4
|
-
import type { DataTrackInfo, DataTrackSid } from '../types';
|
|
5
|
-
import type { DataTrackPublishError, DataTrackPublishErrorReason } from './errors';
|
|
6
|
-
/** Options for publishing a data track. */
|
|
7
|
-
export type DataTrackOptions = {
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
/** Encodes whether a data track publish request to the SFU has been successful or not. */
|
|
11
|
-
export type SfuPublishResponseResult = {
|
|
12
|
-
type: 'ok';
|
|
13
|
-
data: DataTrackInfo;
|
|
14
|
-
} | {
|
|
15
|
-
type: 'error';
|
|
16
|
-
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.InvalidName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached> | DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
17
|
-
};
|
|
18
|
-
/** Request sent to the SFU to publish a track. */
|
|
19
|
-
export type EventSfuPublishRequest = {
|
|
20
|
-
handle: DataTrackHandle;
|
|
21
|
-
name: string;
|
|
22
|
-
usesE2ee: boolean;
|
|
23
|
-
};
|
|
24
|
-
/** Request sent to the SFU to unpublish a track. */
|
|
25
|
-
export type EventSfuUnpublishRequest = {
|
|
26
|
-
handle: DataTrackHandle;
|
|
27
|
-
};
|
|
28
|
-
/** A serialized packet is ready to be sent over the transport. */
|
|
29
|
-
export type EventPacketAvailable = {
|
|
30
|
-
/** The handle associated with the data track which this packet bytes belong to. */
|
|
31
|
-
handle: DataTrackHandle;
|
|
32
|
-
bytes: NonSharedUint8Array;
|
|
33
|
-
};
|
|
34
|
-
/** A track has been created by a local participant and is available to be
|
|
35
|
-
* subscribed to. */
|
|
36
|
-
export type EventTrackPublished = {
|
|
37
|
-
track: LocalDataTrack;
|
|
38
|
-
};
|
|
39
|
-
/** A track has been unpublished by a remote participant and can no longer be subscribed to. */
|
|
40
|
-
export type EventTrackUnpublished = {
|
|
41
|
-
sid: DataTrackSid;
|
|
42
|
-
};
|
|
43
|
-
/** A track has had all of its in flight packets sent via the rtc data channel. */
|
|
44
|
-
export type EventPacketsFlushedChange = {
|
|
45
|
-
handle: DataTrackHandle;
|
|
46
|
-
isFlushed: boolean;
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=types.d.ts.map
|
|
1
|
+
import type { NonSharedUint8Array } from '../../../type-polyfills/non-shared-typed-arrays';
|
|
2
|
+
import type LocalDataTrack from '../LocalDataTrack';
|
|
3
|
+
import type { DataTrackHandle } from '../handle';
|
|
4
|
+
import type { DataTrackInfo, DataTrackSid } from '../types';
|
|
5
|
+
import type { DataTrackPublishError, DataTrackPublishErrorReason } from './errors';
|
|
6
|
+
/** Options for publishing a data track. */
|
|
7
|
+
export type DataTrackOptions = {
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
/** Encodes whether a data track publish request to the SFU has been successful or not. */
|
|
11
|
+
export type SfuPublishResponseResult = {
|
|
12
|
+
type: 'ok';
|
|
13
|
+
data: DataTrackInfo;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'error';
|
|
16
|
+
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.InvalidName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached> | DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
17
|
+
};
|
|
18
|
+
/** Request sent to the SFU to publish a track. */
|
|
19
|
+
export type EventSfuPublishRequest = {
|
|
20
|
+
handle: DataTrackHandle;
|
|
21
|
+
name: string;
|
|
22
|
+
usesE2ee: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Request sent to the SFU to unpublish a track. */
|
|
25
|
+
export type EventSfuUnpublishRequest = {
|
|
26
|
+
handle: DataTrackHandle;
|
|
27
|
+
};
|
|
28
|
+
/** A serialized packet is ready to be sent over the transport. */
|
|
29
|
+
export type EventPacketAvailable = {
|
|
30
|
+
/** The handle associated with the data track which this packet bytes belong to. */
|
|
31
|
+
handle: DataTrackHandle;
|
|
32
|
+
bytes: NonSharedUint8Array;
|
|
33
|
+
};
|
|
34
|
+
/** A track has been created by a local participant and is available to be
|
|
35
|
+
* subscribed to. */
|
|
36
|
+
export type EventTrackPublished = {
|
|
37
|
+
track: LocalDataTrack;
|
|
38
|
+
};
|
|
39
|
+
/** A track has been unpublished by a remote participant and can no longer be subscribed to. */
|
|
40
|
+
export type EventTrackUnpublished = {
|
|
41
|
+
sid: DataTrackSid;
|
|
42
|
+
};
|
|
43
|
+
/** A track has had all of its in flight packets sent via the rtc data channel. */
|
|
44
|
+
export type EventPacketsFlushedChange = {
|
|
45
|
+
handle: DataTrackHandle;
|
|
46
|
+
isFlushed: boolean;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare const U8_LENGTH_BYTES = 1;
|
|
2
|
-
export declare const U16_LENGTH_BYTES = 2;
|
|
3
|
-
export declare const U32_LENGTH_BYTES = 4;
|
|
4
|
-
export declare const U64_LENGTH_BYTES = 8;
|
|
5
|
-
export declare const SUPPORTED_VERSION = 0;
|
|
6
|
-
export declare const BASE_HEADER_LEN = 12;
|
|
7
|
-
export declare const VERSION_SHIFT = 5;
|
|
8
|
-
export declare const VERSION_MASK = 7;
|
|
9
|
-
export declare const FRAME_MARKER_SHIFT = 3;
|
|
10
|
-
export declare const FRAME_MARKER_MASK = 3;
|
|
11
|
-
export declare const FRAME_MARKER_START = 2;
|
|
12
|
-
export declare const FRAME_MARKER_FINAL = 1;
|
|
13
|
-
export declare const FRAME_MARKER_INTER = 0;
|
|
14
|
-
export declare const FRAME_MARKER_SINGLE = 3;
|
|
15
|
-
export declare const EXT_WORDS_INDICATOR_SIZE = 2;
|
|
16
|
-
export declare const EXT_FLAG_SHIFT = 2;
|
|
17
|
-
export declare const EXT_FLAG_MASK = 1;
|
|
18
|
-
export declare const EXT_MARKER_LEN = 4;
|
|
19
|
-
export declare const EXT_TAG_PADDING = 0;
|
|
20
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
1
|
+
export declare const U8_LENGTH_BYTES = 1;
|
|
2
|
+
export declare const U16_LENGTH_BYTES = 2;
|
|
3
|
+
export declare const U32_LENGTH_BYTES = 4;
|
|
4
|
+
export declare const U64_LENGTH_BYTES = 8;
|
|
5
|
+
export declare const SUPPORTED_VERSION = 0;
|
|
6
|
+
export declare const BASE_HEADER_LEN = 12;
|
|
7
|
+
export declare const VERSION_SHIFT = 5;
|
|
8
|
+
export declare const VERSION_MASK = 7;
|
|
9
|
+
export declare const FRAME_MARKER_SHIFT = 3;
|
|
10
|
+
export declare const FRAME_MARKER_MASK = 3;
|
|
11
|
+
export declare const FRAME_MARKER_START = 2;
|
|
12
|
+
export declare const FRAME_MARKER_FINAL = 1;
|
|
13
|
+
export declare const FRAME_MARKER_INTER = 0;
|
|
14
|
+
export declare const FRAME_MARKER_SINGLE = 3;
|
|
15
|
+
export declare const EXT_WORDS_INDICATOR_SIZE = 2;
|
|
16
|
+
export declare const EXT_FLAG_SHIFT = 2;
|
|
17
|
+
export declare const EXT_FLAG_MASK = 1;
|
|
18
|
+
export declare const EXT_MARKER_LEN = 4;
|
|
19
|
+
export declare const EXT_TAG_PADDING = 0;
|
|
20
|
+
//# sourceMappingURL=constants.d.ts.map
|