livekit-client 2.18.0 → 2.18.1
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 +8 -7
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +7832 -5799
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +12 -4
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +6 -0
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/utils.d.ts +2 -1
- package/dist/src/e2ee/utils.d.ts.map +1 -1
- package/dist/src/e2ee/worker/DataCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/room/PCTransport.d.ts +5 -0
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/PCTransportManager.d.ts +1 -1
- package/dist/src/room/PCTransportManager.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +24 -8
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +13 -3
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts.map +1 -1
- package/dist/src/room/data-track/LocalDataTrack.d.ts +28 -5
- package/dist/src/room/data-track/LocalDataTrack.d.ts.map +1 -1
- package/dist/src/room/data-track/RemoteDataTrack.d.ts +5 -5
- package/dist/src/room/data-track/RemoteDataTrack.d.ts.map +1 -1
- package/dist/src/room/data-track/depacketizer.d.ts +4 -4
- package/dist/src/room/data-track/depacketizer.d.ts.map +1 -1
- package/dist/src/room/data-track/frame.d.ts +14 -0
- package/dist/src/room/data-track/frame.d.ts.map +1 -1
- package/dist/src/room/data-track/incoming/IncomingDataTrackManager.d.ts +19 -11
- package/dist/src/room/data-track/incoming/IncomingDataTrackManager.d.ts.map +1 -1
- package/dist/src/room/data-track/incoming/pipeline.d.ts +6 -5
- package/dist/src/room/data-track/incoming/pipeline.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +57 -23
- package/dist/src/room/data-track/outgoing/OutgoingDataTrackManager.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/errors.d.ts +16 -6
- package/dist/src/room/data-track/outgoing/errors.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/pipeline.d.ts +7 -6
- package/dist/src/room/data-track/outgoing/pipeline.d.ts.map +1 -1
- package/dist/src/room/data-track/outgoing/types.d.ts +14 -4
- package/dist/src/room/data-track/outgoing/types.d.ts.map +1 -1
- package/dist/src/room/data-track/packet/extensions.d.ts.map +1 -1
- package/dist/src/room/data-track/packetizer.d.ts +4 -4
- package/dist/src/room/data-track/packetizer.d.ts.map +1 -1
- package/dist/src/room/data-track/track-interfaces.d.ts +1 -1
- package/dist/src/room/data-track/track-interfaces.d.ts.map +1 -1
- package/dist/src/room/data-track/types.d.ts +6 -1
- package/dist/src/room/data-track/types.d.ts.map +1 -1
- package/dist/src/room/events.d.ts +24 -3
- package/dist/src/room/events.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +11 -1
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +13 -0
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +1 -0
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/utils/deferrable-map.d.ts +32 -0
- package/dist/src/utils/deferrable-map.d.ts.map +1 -0
- package/dist/ts4.2/api/SignalClient.d.ts +12 -4
- package/dist/ts4.2/e2ee/types.d.ts +6 -0
- package/dist/ts4.2/e2ee/utils.d.ts +2 -1
- package/dist/ts4.2/index.d.ts +5 -4
- package/dist/ts4.2/room/PCTransport.d.ts +5 -0
- package/dist/ts4.2/room/PCTransportManager.d.ts +1 -1
- package/dist/ts4.2/room/RTCEngine.d.ts +24 -8
- package/dist/ts4.2/room/Room.d.ts +13 -3
- package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +27 -4
- package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +4 -4
- package/dist/ts4.2/room/data-track/depacketizer.d.ts +4 -4
- package/dist/ts4.2/room/data-track/frame.d.ts +14 -0
- package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +21 -10
- package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +6 -5
- package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +57 -23
- package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +16 -6
- package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +7 -6
- package/dist/ts4.2/room/data-track/outgoing/types.d.ts +14 -4
- package/dist/ts4.2/room/data-track/packetizer.d.ts +4 -4
- package/dist/ts4.2/room/data-track/track-interfaces.d.ts +1 -1
- package/dist/ts4.2/room/data-track/types.d.ts +6 -1
- package/dist/ts4.2/room/events.d.ts +24 -3
- package/dist/ts4.2/room/participant/LocalParticipant.d.ts +11 -1
- package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +13 -0
- package/dist/ts4.2/room/utils.d.ts +1 -0
- package/dist/ts4.2/utils/deferrable-map.d.ts +32 -0
- package/package.json +1 -1
- package/src/api/SignalClient.test.ts +9 -4
- package/src/api/SignalClient.ts +116 -9
- package/src/e2ee/constants.ts +1 -0
- package/src/e2ee/types.ts +6 -0
- package/src/e2ee/utils.ts +4 -3
- package/src/e2ee/worker/DataCryptor.ts +1 -4
- package/src/e2ee/worker/FrameCryptor.ts +1 -4
- package/src/e2ee/worker/ParticipantKeyHandler.ts +1 -1
- package/src/index.ts +6 -4
- package/src/room/PCTransport.ts +41 -1
- package/src/room/PCTransportManager.ts +1 -1
- package/src/room/RTCEngine.ts +266 -111
- package/src/room/Room.ts +149 -12
- package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +7 -7
- package/src/room/data-track/LocalDataTrack.ts +83 -10
- package/src/room/data-track/RemoteDataTrack.ts +7 -9
- package/src/room/data-track/depacketizer.ts +21 -12
- package/src/room/data-track/frame.ts +28 -2
- package/src/room/data-track/incoming/IncomingDataTrackManager.test.ts +58 -73
- package/src/room/data-track/incoming/IncomingDataTrackManager.ts +132 -80
- package/src/room/data-track/incoming/pipeline.ts +29 -24
- package/src/room/data-track/outgoing/OutgoingDataTrackManager.test.ts +225 -32
- package/src/room/data-track/outgoing/OutgoingDataTrackManager.ts +150 -75
- package/src/room/data-track/outgoing/errors.ts +36 -7
- package/src/room/data-track/outgoing/pipeline.ts +23 -17
- package/src/room/data-track/outgoing/types.ts +12 -3
- package/src/room/data-track/packet/extensions.ts +17 -22
- package/src/room/data-track/packet/index.test.ts +22 -33
- package/src/room/data-track/packetizer.test.ts +2 -2
- package/src/room/data-track/packetizer.ts +4 -4
- package/src/room/data-track/track-interfaces.ts +1 -1
- package/src/room/data-track/types.ts +21 -1
- package/src/room/events.ts +26 -1
- package/src/room/participant/LocalParticipant.ts +57 -6
- package/src/room/participant/RemoteParticipant.ts +25 -0
- package/src/room/utils.ts +4 -0
- package/src/utils/deferrable-map.ts +109 -0
- package/dist/src/room/data-track/e2ee.d.ts +0 -12
- package/dist/src/room/data-track/e2ee.d.ts.map +0 -1
- package/dist/ts4.2/room/data-track/e2ee.d.ts +0 -12
- package/src/room/data-track/e2ee.ts +0 -15
|
@@ -6,11 +6,11 @@ import type { DataTrackInfo } from './types';
|
|
|
6
6
|
type RemoteDataTrackOptions = {
|
|
7
7
|
publisherIdentity: Participant['identity'];
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type DataTrackSubscribeOptions = {
|
|
10
10
|
signal?: AbortSignal;
|
|
11
11
|
/** The number of {@link DataTrackFrame}s to hold in the ReadableStream before disgarding extra
|
|
12
|
-
* frames. Defaults to
|
|
13
|
-
|
|
12
|
+
* frames. Defaults to 16, but this may not be good enough for especially high frequency data. */
|
|
13
|
+
bufferSize?: number;
|
|
14
14
|
};
|
|
15
15
|
export default class RemoteDataTrack implements IRemoteTrack, IDataTrack {
|
|
16
16
|
readonly trackSymbol: symbol;
|
|
@@ -40,7 +40,7 @@ export default class RemoteDataTrack implements IRemoteTrack, IDataTrack {
|
|
|
40
40
|
* Note that newly created subscriptions only receive frames published after
|
|
41
41
|
* the initial subscription is established.
|
|
42
42
|
*/
|
|
43
|
-
subscribe(options?:
|
|
43
|
+
subscribe(options?: DataTrackSubscribeOptions): ReadableStream<DataTrackFrame>;
|
|
44
44
|
}
|
|
45
45
|
export {};
|
|
46
46
|
//# sourceMappingURL=RemoteDataTrack.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
2
|
import { LivekitReasonedError } from '../errors';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DataTrackFrameInternal } from './frame';
|
|
4
4
|
import { DataTrackPacket } from './packet';
|
|
5
5
|
/** An error indicating a frame was dropped. */
|
|
6
6
|
export declare class DataTrackDepacketizerDropError<Reason extends DataTrackDepacketizerDropReason = DataTrackDepacketizerDropReason> extends LivekitReasonedError<Reason> {
|
|
@@ -11,7 +11,7 @@ export declare class DataTrackDepacketizerDropError<Reason extends DataTrackDepa
|
|
|
11
11
|
constructor(message: string, reason: Reason, frameNumber: number, options?: {
|
|
12
12
|
cause?: unknown;
|
|
13
13
|
});
|
|
14
|
-
static interrupted(frameNumber: number): DataTrackDepacketizerDropError<DataTrackDepacketizerDropReason.Interrupted>;
|
|
14
|
+
static interrupted(frameNumber: number, newFrameNumber: number): DataTrackDepacketizerDropError<DataTrackDepacketizerDropReason.Interrupted>;
|
|
15
15
|
static unknownFrame(frameNumber: number): DataTrackDepacketizerDropError<DataTrackDepacketizerDropReason.UnknownFrame>;
|
|
16
16
|
static bufferFull(frameNumber: number): DataTrackDepacketizerDropError<DataTrackDepacketizerDropReason.BufferFull>;
|
|
17
17
|
static incomplete(frameNumber: number, receivedPackets: number, expectedPackets: number): DataTrackDepacketizerDropError<DataTrackDepacketizerDropReason.Incomplete>;
|
|
@@ -35,9 +35,9 @@ export default class DataTrackDepacketizer {
|
|
|
35
35
|
/** Should be repeatedly called with received {@link DataTrackPacket}s - intermediate calls
|
|
36
36
|
* aggregate the packet's state internally, and return null.
|
|
37
37
|
*
|
|
38
|
-
* Once this method is called with the final packet to form a frame, a new {@link
|
|
38
|
+
* Once this method is called with the final packet to form a frame, a new {@link DataTrackFrameInternal}
|
|
39
39
|
* is returned.*/
|
|
40
|
-
push(packet: DataTrackPacket, options?: PushOptions): Throws<
|
|
40
|
+
push(packet: DataTrackPacket, options?: PushOptions): Throws<DataTrackFrameInternal | null, DataTrackDepacketizerDropError>;
|
|
41
41
|
reset(): void;
|
|
42
42
|
private frameFromSingle;
|
|
43
43
|
/** Begin assembling a new packet. */
|
|
@@ -1,7 +1,21 @@
|
|
|
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: Uint8Array;
|
|
5
|
+
userTimestamp?: bigint;
|
|
6
|
+
};
|
|
7
|
+
/** An internal representation o data track frame which contains all SFU metadata. */
|
|
8
|
+
export type DataTrackFrameInternal = {
|
|
4
9
|
payload: Uint8Array;
|
|
5
10
|
extensions: DataTrackExtensions;
|
|
6
11
|
};
|
|
12
|
+
export declare const DataTrackFrameInternal: {
|
|
13
|
+
from(frame: DataTrackFrame): {
|
|
14
|
+
payload: Uint8Array<ArrayBufferLike>;
|
|
15
|
+
extensions: DataTrackExtensions;
|
|
16
|
+
};
|
|
17
|
+
/** Converts from a DataTrackFrameInternal -> DataTrackFrame. Some internal information is
|
|
18
|
+
* discarded like e2ee encrption extension data. */
|
|
19
|
+
lossyIntoFrame(frame: DataTrackFrameInternal): DataTrackFrame;
|
|
20
|
+
};
|
|
7
21
|
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
2
|
import type TypedEmitter from 'typed-emitter';
|
|
3
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
3
4
|
import type Participant from '../../participant/Participant';
|
|
4
5
|
import type RemoteParticipant from '../../participant/RemoteParticipant';
|
|
5
6
|
import { DataTrackDepacketizerDropError } from '../depacketizer';
|
|
6
|
-
import type { DecryptionProvider } from '../e2ee';
|
|
7
7
|
import type { DataTrackFrame } from '../frame';
|
|
8
8
|
import { DataTrackHandle } from '../handle';
|
|
9
9
|
import type { DataTrackInfo, DataTrackSid } from '../types';
|
|
@@ -14,20 +14,20 @@ export type DataTrackIncomingManagerCallbacks = {
|
|
|
14
14
|
sfuUpdateSubscription: (event: EventSfuUpdateSubscription) => void;
|
|
15
15
|
/** A track has been published by a remote participant and is available to be
|
|
16
16
|
* subscribed to. */
|
|
17
|
-
|
|
17
|
+
trackPublished: (event: EventTrackAvailable) => void;
|
|
18
18
|
/** A track has been unpublished by a remote participant and can no longer be subscribed to. */
|
|
19
|
-
|
|
19
|
+
trackUnpublished: (event: EventTrackUnavailable) => void;
|
|
20
20
|
};
|
|
21
21
|
type IncomingDataTrackManagerOptions = {
|
|
22
22
|
/** Provider to use for decrypting incoming frame payloads.
|
|
23
23
|
* If none, remote tracks using end-to-end encryption will not be available
|
|
24
24
|
* for subscription.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
e2eeManager?: BaseE2EEManager;
|
|
27
27
|
};
|
|
28
28
|
declare const IncomingDataTrackManager_base: new () => TypedEmitter<DataTrackIncomingManagerCallbacks>;
|
|
29
29
|
export default class IncomingDataTrackManager extends IncomingDataTrackManager_base {
|
|
30
|
-
private
|
|
30
|
+
private e2eeManager;
|
|
31
31
|
/** Mapping between track SID and descriptor. */
|
|
32
32
|
private descriptors;
|
|
33
33
|
/** Mapping between subscriber handle and track SID.
|
|
@@ -38,6 +38,20 @@ export default class IncomingDataTrackManager extends IncomingDataTrackManager_b
|
|
|
38
38
|
*/
|
|
39
39
|
private subscriptionHandles;
|
|
40
40
|
constructor(options?: IncomingDataTrackManagerOptions);
|
|
41
|
+
/** @internal */
|
|
42
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
43
|
+
/** Allocates a ReadableStream which emits when a new {@link DataTrackFrame} is received from the
|
|
44
|
+
* SFU. The SFU subscription is initiated lazily when the stream is created.
|
|
45
|
+
*
|
|
46
|
+
* @returns A tuple of the ReadableStream and a Promise that resolves once the SFU subscription
|
|
47
|
+
* is fully established / the stream is ready to receive frames.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
**/
|
|
51
|
+
openSubscriptionStream(sid: DataTrackSid, signal?: AbortSignal, bufferSize?: number): [
|
|
52
|
+
ReadableStream<DataTrackFrame>,
|
|
53
|
+
Promise<Throws<void, DataTrackSubscribeError>>
|
|
54
|
+
];
|
|
41
55
|
/** Client requested to subscribe to a data track.
|
|
42
56
|
*
|
|
43
57
|
* This is sent when the user calls {@link RemoteDataTrack.subscribe}.
|
|
@@ -46,10 +60,7 @@ export default class IncomingDataTrackManager extends IncomingDataTrackManager_b
|
|
|
46
60
|
* requests simply attach an additional receiver to the broadcast channel, allowing them to consume
|
|
47
61
|
* frames from the existing subscription pipeline.
|
|
48
62
|
*/
|
|
49
|
-
subscribeRequest(sid: DataTrackSid, signal?: AbortSignal
|
|
50
|
-
/** Allocates a ReadableStream which emits when a new {@link DataTrackFrame} is received from the
|
|
51
|
-
* SFU. */
|
|
52
|
-
private createReadableStream;
|
|
63
|
+
subscribeRequest(sid: DataTrackSid, signal?: AbortSignal): Promise<Throws<void, DataTrackSubscribeError>>;
|
|
53
64
|
/**
|
|
54
65
|
* Get information about all currently subscribed tracks.
|
|
55
66
|
* @internal */
|
|
@@ -82,7 +93,7 @@ export default class IncomingDataTrackManager extends IncomingDataTrackManager_b
|
|
|
82
93
|
mapping: Map<DataTrackHandle, DataTrackSid>): void;
|
|
83
94
|
private registerSubscriberHandle;
|
|
84
95
|
/** Packet has been received over the transport. */
|
|
85
|
-
packetReceived(bytes: Uint8Array): Throws<void, DataTrackDepacketizerDropError
|
|
96
|
+
packetReceived(bytes: Uint8Array): Promise<Throws<void, DataTrackDepacketizerDropError>>;
|
|
86
97
|
/** Resend all subscription updates.
|
|
87
98
|
*
|
|
88
99
|
* This must be sent after a full reconnect to ensure the SFU knows which
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
2
3
|
import { DataTrackDepacketizerDropError } from '../depacketizer';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataTrackFrame } from '../frame';
|
|
4
|
+
import type { DataTrackFrameInternal } from '../frame';
|
|
5
5
|
import { DataTrackPacket } from '../packet';
|
|
6
6
|
import type { DataTrackInfo } from '../types';
|
|
7
7
|
/**
|
|
@@ -10,20 +10,21 @@ import type { DataTrackInfo } from '../types';
|
|
|
10
10
|
type Options = {
|
|
11
11
|
info: DataTrackInfo;
|
|
12
12
|
publisherIdentity: string;
|
|
13
|
-
|
|
13
|
+
e2eeManager: BaseE2EEManager | null;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* Pipeline for an individual data track subscription.
|
|
17
17
|
*/
|
|
18
18
|
export default class IncomingDataTrackPipeline {
|
|
19
19
|
private publisherIdentity;
|
|
20
|
-
private
|
|
20
|
+
private e2eeManager;
|
|
21
21
|
private depacketizer;
|
|
22
22
|
/**
|
|
23
23
|
* Creates a new pipeline with the given options.
|
|
24
24
|
*/
|
|
25
25
|
constructor(options: Options);
|
|
26
|
-
|
|
26
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
27
|
+
processPacket(packet: DataTrackPacket): Promise<Throws<DataTrackFrameInternal | null, DataTrackDepacketizerDropError>>;
|
|
27
28
|
/**
|
|
28
29
|
* Depacketize the given frame, log if a drop occurs.
|
|
29
30
|
*/
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
2
|
import type TypedEmitter from 'typed-emitter';
|
|
3
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
3
4
|
import { Future } from '../../utils';
|
|
4
|
-
import
|
|
5
|
-
import type { EncryptionProvider } from '../e2ee';
|
|
5
|
+
import type { DataTrackFrameInternal } from '../frame';
|
|
6
6
|
import { DataTrackHandle } from '../handle';
|
|
7
7
|
import type { DataTrackInfo } from '../types';
|
|
8
|
-
import { DataTrackPublishError,
|
|
8
|
+
import { DataTrackPublishError, DataTrackPushFrameError, DataTrackPushFrameErrorReason } from './errors';
|
|
9
9
|
import DataTrackOutgoingPipeline from './pipeline';
|
|
10
|
-
import type { DataTrackOptions,
|
|
10
|
+
import type { DataTrackOptions, EventPacketAvailable, 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. */
|
|
14
|
+
completionFuture: Future<void, DataTrackPublishError>;
|
|
14
15
|
};
|
|
15
16
|
export type ActiveDescriptor = {
|
|
16
17
|
type: 'active';
|
|
17
18
|
info: DataTrackInfo;
|
|
19
|
+
publishState: 'published' | 'republishing' | 'unpublished';
|
|
18
20
|
pipeline: DataTrackOutgoingPipeline;
|
|
19
21
|
/** Resolves when the descriptor is unpublished. */
|
|
20
22
|
unpublishingFuture: Future<void, never>;
|
|
@@ -22,55 +24,87 @@ export type ActiveDescriptor = {
|
|
|
22
24
|
export type Descriptor = PendingDescriptor | ActiveDescriptor;
|
|
23
25
|
export declare const Descriptor: {
|
|
24
26
|
pending(): PendingDescriptor;
|
|
25
|
-
active(info: DataTrackInfo,
|
|
27
|
+
active(info: DataTrackInfo, e2eeManager: BaseE2EEManager | null): ActiveDescriptor;
|
|
26
28
|
};
|
|
27
29
|
export type DataTrackOutgoingManagerCallbacks = {
|
|
28
30
|
/** Request sent to the SFU to publish a track. */
|
|
29
31
|
sfuPublishRequest: (event: EventSfuPublishRequest) => void;
|
|
30
32
|
/** Request sent to the SFU to unpublish a track. */
|
|
31
33
|
sfuUnpublishRequest: (event: EventSfuUnpublishRequest) => void;
|
|
32
|
-
/**
|
|
33
|
-
|
|
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;
|
|
34
40
|
};
|
|
35
41
|
type OutgoingDataTrackManagerOptions = {
|
|
36
42
|
/**
|
|
37
43
|
* Provider to use for encrypting outgoing frame payloads.
|
|
38
44
|
*
|
|
39
|
-
* If
|
|
45
|
+
* If null, end-to-end encryption will be disabled for all published tracks.
|
|
40
46
|
*/
|
|
41
|
-
|
|
47
|
+
e2eeManager?: BaseE2EEManager;
|
|
42
48
|
};
|
|
43
49
|
declare const OutgoingDataTrackManager_base: new () => TypedEmitter<DataTrackOutgoingManagerCallbacks>;
|
|
44
50
|
export default class OutgoingDataTrackManager extends OutgoingDataTrackManager_base {
|
|
45
|
-
private
|
|
51
|
+
private e2eeManager;
|
|
46
52
|
private handleAllocator;
|
|
47
53
|
private descriptors;
|
|
48
54
|
constructor(options?: OutgoingDataTrackManagerOptions);
|
|
49
55
|
static withDescriptors(descriptors: Map<DataTrackHandle, Descriptor>): OutgoingDataTrackManager;
|
|
56
|
+
/** @internal */
|
|
57
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
50
58
|
/**
|
|
51
59
|
* Used by attached {@link LocalDataTrack} instances to query their associated descriptor info.
|
|
52
60
|
* @internal
|
|
53
61
|
*/
|
|
54
62
|
getDescriptor(handle: DataTrackHandle): Descriptor | null;
|
|
55
|
-
createLocalDataTrack(handle: DataTrackHandle): LocalDataTrack | null;
|
|
56
63
|
/** Used by attached {@link LocalDataTrack} instances to broadcast data track packets to other
|
|
57
64
|
* subscribers.
|
|
58
65
|
* @internal
|
|
59
66
|
*/
|
|
60
|
-
tryProcessAndSend(handle: DataTrackHandle,
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
tryProcessAndSend(handle: DataTrackHandle, frame: DataTrackFrameInternal): Promise<Throws<void, DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped> | DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>>>;
|
|
68
|
+
/**
|
|
69
|
+
* Client requested to publish a track.
|
|
70
|
+
*
|
|
71
|
+
* If the LiveKit server is too old and doesn't support data tracks, a
|
|
72
|
+
* {@link DataTrackPublishError#timeout} will be thrown.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
**/
|
|
76
|
+
publishRequest(options: DataTrackOptions, signal?: AbortSignal): Promise<Throws<DataTrackHandle, DataTrackPublishError>>;
|
|
77
|
+
/**
|
|
78
|
+
* Get information about all currently published tracks.
|
|
79
|
+
* @internal
|
|
80
|
+
**/
|
|
81
|
+
queryPublished(): DataTrackInfo[];
|
|
82
|
+
/**
|
|
83
|
+
* Client request to unpublish a track.
|
|
84
|
+
* @internal
|
|
85
|
+
**/
|
|
68
86
|
unpublishRequest(handle: DataTrackHandle): Promise<void>;
|
|
69
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* SFU responded to a request to publish a data track.
|
|
89
|
+
* @internal
|
|
90
|
+
**/
|
|
70
91
|
receivedSfuPublishResponse(handle: DataTrackHandle, result: SfuPublishResponseResult): void;
|
|
71
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* SFU notification that a track has been unpublished.
|
|
94
|
+
* @internal
|
|
95
|
+
**/
|
|
72
96
|
receivedSfuUnpublishResponse(handle: DataTrackHandle): void;
|
|
73
|
-
/**
|
|
97
|
+
/** Republish all tracks.
|
|
98
|
+
*
|
|
99
|
+
* This must be sent after a full reconnect in order for existing publications
|
|
100
|
+
* to be recognized by the SFU. Each republished track will be assigned a new SID.
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
sfuWillRepublishTracks(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Shuts down the manager and all associated tracks.
|
|
106
|
+
* @internal
|
|
107
|
+
**/
|
|
74
108
|
shutdown(): Promise<void>;
|
|
75
109
|
}
|
|
76
110
|
export {};
|
|
@@ -15,19 +15,29 @@ export declare enum DataTrackPublishErrorReason {
|
|
|
15
15
|
LimitReached = 3,
|
|
16
16
|
/** Cannot publish data track when the room is disconnected. */
|
|
17
17
|
Disconnected = 4,
|
|
18
|
-
Cancelled = 5
|
|
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
|
|
19
24
|
}
|
|
20
|
-
export declare class DataTrackPublishError<Reason extends DataTrackPublishErrorReason> extends LivekitReasonedError<Reason> {
|
|
25
|
+
export declare class DataTrackPublishError<Reason extends DataTrackPublishErrorReason = DataTrackPublishErrorReason> extends LivekitReasonedError<Reason> {
|
|
21
26
|
readonly name = "DataTrackPublishError";
|
|
22
27
|
reason: Reason;
|
|
23
28
|
reasonName: string;
|
|
29
|
+
/** Underling message from the SFU, if one was provided */
|
|
30
|
+
rawMessage?: string;
|
|
24
31
|
constructor(message: string, reason: Reason, options?: {
|
|
32
|
+
rawMessage?: string;
|
|
25
33
|
cause?: unknown;
|
|
26
34
|
});
|
|
27
|
-
static notAllowed(): DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed>;
|
|
28
|
-
static duplicateName(): DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName>;
|
|
35
|
+
static notAllowed(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed>;
|
|
36
|
+
static duplicateName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName>;
|
|
37
|
+
static invalidName(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.InvalidName>;
|
|
29
38
|
static timeout(): DataTrackPublishError<DataTrackPublishErrorReason.Timeout>;
|
|
30
|
-
static limitReached(): DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
39
|
+
static limitReached(rawMessage?: string): DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
40
|
+
static unknown(reason: number, message: string): DataTrackPublishError<DataTrackPublishErrorReason.Unknown>;
|
|
31
41
|
static disconnected(): DataTrackPublishError<DataTrackPublishErrorReason.Disconnected>;
|
|
32
42
|
static cancelled(): DataTrackPublishError<DataTrackPublishErrorReason.Cancelled>;
|
|
33
43
|
}
|
|
@@ -45,7 +55,7 @@ export declare class DataTrackPushFrameError<Reason extends DataTrackPushFrameEr
|
|
|
45
55
|
cause?: unknown;
|
|
46
56
|
});
|
|
47
57
|
static trackUnpublished(): DataTrackPushFrameError<DataTrackPushFrameErrorReason.TrackUnpublished>;
|
|
48
|
-
static dropped(cause
|
|
58
|
+
static dropped(cause?: unknown): DataTrackPushFrameError<DataTrackPushFrameErrorReason.Dropped>;
|
|
49
59
|
}
|
|
50
60
|
export declare enum DataTrackOutgoingPipelineErrorReason {
|
|
51
61
|
Packetizer = 0,
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { BaseE2EEManager } from '../../../e2ee/E2eeManager';
|
|
3
|
+
import type { DataTrackFrameInternal } from '../frame';
|
|
4
4
|
import { DataTrackPacket } from '../packet';
|
|
5
5
|
import type { DataTrackInfo } from '../types';
|
|
6
6
|
import { DataTrackOutgoingPipelineError, DataTrackOutgoingPipelineErrorReason } from './errors';
|
|
7
7
|
type Options = {
|
|
8
8
|
info: DataTrackInfo;
|
|
9
|
-
|
|
9
|
+
e2eeManager: BaseE2EEManager | null;
|
|
10
10
|
};
|
|
11
11
|
/** Processes outgoing frames into final packets for distribution to the SFU. */
|
|
12
12
|
export default class DataTrackOutgoingPipeline {
|
|
13
|
-
private
|
|
13
|
+
private e2eeManager;
|
|
14
14
|
private packetizer;
|
|
15
15
|
/** Maximum transmission unit (MTU) of the transport. */
|
|
16
16
|
private static TRANSPORT_MTU_BYTES;
|
|
17
17
|
constructor(options: Options);
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
updateE2eeManager(e2eeManager: BaseE2EEManager | null): void;
|
|
19
|
+
processFrame(frame: DataTrackFrameInternal): Throws<AsyncGenerator<DataTrackPacket>, DataTrackOutgoingPipelineError>;
|
|
20
|
+
encryptIfNeeded(frame: DataTrackFrameInternal): Promise<Throws<DataTrackFrameInternal, DataTrackOutgoingPipelineError<DataTrackOutgoingPipelineErrorReason.Encryption>>>;
|
|
20
21
|
}
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type LocalDataTrack from '../LocalDataTrack';
|
|
1
2
|
import type { DataTrackHandle } from '../handle';
|
|
2
|
-
import type { DataTrackInfo } from '../types';
|
|
3
|
+
import type { DataTrackInfo, DataTrackSid } from '../types';
|
|
3
4
|
import type { DataTrackPublishError, DataTrackPublishErrorReason } from './errors';
|
|
4
5
|
/** Options for publishing a data track. */
|
|
5
6
|
export type DataTrackOptions = {
|
|
@@ -11,7 +12,7 @@ export type SfuPublishResponseResult = {
|
|
|
11
12
|
data: DataTrackInfo;
|
|
12
13
|
} | {
|
|
13
14
|
type: 'error';
|
|
14
|
-
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
15
|
+
error: DataTrackPublishError<DataTrackPublishErrorReason.NotAllowed> | DataTrackPublishError<DataTrackPublishErrorReason.DuplicateName> | DataTrackPublishError<DataTrackPublishErrorReason.InvalidName> | DataTrackPublishError<DataTrackPublishErrorReason.LimitReached>;
|
|
15
16
|
};
|
|
16
17
|
/** Request sent to the SFU to publish a track. */
|
|
17
18
|
export type EventSfuPublishRequest = {
|
|
@@ -23,8 +24,17 @@ export type EventSfuPublishRequest = {
|
|
|
23
24
|
export type EventSfuUnpublishRequest = {
|
|
24
25
|
handle: DataTrackHandle;
|
|
25
26
|
};
|
|
26
|
-
/**
|
|
27
|
-
export type
|
|
27
|
+
/** A serialized packet is ready to be sent over the transport. */
|
|
28
|
+
export type EventPacketAvailable = {
|
|
28
29
|
bytes: Uint8Array;
|
|
29
30
|
};
|
|
31
|
+
/** A track has been created by a local participant and is available to be
|
|
32
|
+
* subscribed to. */
|
|
33
|
+
export type EventTrackPublished = {
|
|
34
|
+
track: LocalDataTrack;
|
|
35
|
+
};
|
|
36
|
+
/** A track has been unpublished by a remote participant and can no longer be subscribed to. */
|
|
37
|
+
export type EventTrackUnpublished = {
|
|
38
|
+
sid: DataTrackSid;
|
|
39
|
+
};
|
|
30
40
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
2
2
|
import { LivekitReasonedError } from '../errors';
|
|
3
|
-
import type {
|
|
3
|
+
import type { DataTrackFrameInternal } from './frame';
|
|
4
4
|
import { DataTrackHandle } from './handle';
|
|
5
5
|
import { DataTrackPacket, FrameMarker } from './packet';
|
|
6
6
|
import { DataTrackTimestamp } from './utils';
|
|
@@ -21,7 +21,7 @@ export declare class DataTrackPacketizerError<Reason extends DataTrackPacketizer
|
|
|
21
21
|
export declare enum DataTrackPacketizerReason {
|
|
22
22
|
MtuTooShort = 0
|
|
23
23
|
}
|
|
24
|
-
/** A packetizer takes a {@link
|
|
24
|
+
/** A packetizer takes a {@link DataTrackFrameInternal} as input and generates a series
|
|
25
25
|
* of {@link DataTrackPacket}s for transmission to other clients over webrtc. */
|
|
26
26
|
export default class DataTrackPacketizer {
|
|
27
27
|
private handle;
|
|
@@ -32,12 +32,12 @@ export default class DataTrackPacketizer {
|
|
|
32
32
|
constructor(trackHandle: DataTrackHandle, mtuSizeBytes: number);
|
|
33
33
|
/** @internal */
|
|
34
34
|
static computeFrameMarker(index: number, packetCount: number): FrameMarker;
|
|
35
|
-
/** Generates a series of packets for the specified {@link
|
|
35
|
+
/** Generates a series of packets for the specified {@link DataTrackFrameInternal}.
|
|
36
36
|
*
|
|
37
37
|
* NOTE: The return value of this function is a generator, so it can be lazily ran if desired,
|
|
38
38
|
* or converted to an array with {@link Array.from}.
|
|
39
39
|
*/
|
|
40
|
-
packetize(frame:
|
|
40
|
+
packetize(frame: DataTrackFrameInternal, options?: PacketizeOptions): Throws<Generator<DataTrackPacket>, DataTrackPacketizerError>;
|
|
41
41
|
}
|
|
42
42
|
export {};
|
|
43
43
|
//# sourceMappingURL=packetizer.d.ts.map
|
|
@@ -17,7 +17,7 @@ export declare const DataTrackSymbol: symbol;
|
|
|
17
17
|
/** An interface representing a data track, either local or remote. */
|
|
18
18
|
export interface IDataTrack extends ITrack {
|
|
19
19
|
readonly typeSymbol: typeof DataTrackSymbol;
|
|
20
|
-
readonly info
|
|
20
|
+
readonly info?: DataTrackInfo;
|
|
21
21
|
}
|
|
22
22
|
export declare function isDataTrack(subject: unknown): subject is IDataTrack;
|
|
23
23
|
//# sourceMappingURL=track-interfaces.d.ts.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { DataTrackInfo as ProtocolDataTrackInfo } from '@livekit/protocol';
|
|
1
2
|
import type { DataTrackHandle } from './handle';
|
|
2
3
|
export type DataTrackSid = string;
|
|
3
4
|
/** Information about a published data track. */
|
|
4
5
|
export type DataTrackInfo = {
|
|
5
6
|
sid: DataTrackSid;
|
|
6
7
|
pubHandle: DataTrackHandle;
|
|
7
|
-
name:
|
|
8
|
+
name: string;
|
|
8
9
|
usesE2ee: boolean;
|
|
9
10
|
};
|
|
11
|
+
export declare const DataTrackInfo: {
|
|
12
|
+
from(protocolInfo: ProtocolDataTrackInfo): DataTrackInfo;
|
|
13
|
+
toProtobuf(info: DataTrackInfo): ProtocolDataTrackInfo;
|
|
14
|
+
};
|
|
10
15
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -291,7 +291,7 @@ export declare enum RoomEvent {
|
|
|
291
291
|
EncryptionError = "encryptionError",
|
|
292
292
|
/**
|
|
293
293
|
* Emits whenever the current buffer status of a data channel changes
|
|
294
|
-
* args: (isLow: boolean, kind: [[
|
|
294
|
+
* args: (isLow: boolean, kind: [[DataChannelKind]])
|
|
295
295
|
*/
|
|
296
296
|
DCBufferStatusChanged = "dcBufferStatusChanged",
|
|
297
297
|
/**
|
|
@@ -307,7 +307,23 @@ export declare enum RoomEvent {
|
|
|
307
307
|
/**
|
|
308
308
|
* fired when the client receives connection metrics from other participants
|
|
309
309
|
*/
|
|
310
|
-
MetricsReceived = "metricsReceived"
|
|
310
|
+
MetricsReceived = "metricsReceived",
|
|
311
|
+
/**
|
|
312
|
+
* Emits when a new data track has been published by a downstream participant.
|
|
313
|
+
*/
|
|
314
|
+
DataTrackPublished = "dataTrackPublished",
|
|
315
|
+
/**
|
|
316
|
+
* Emits when a new data track has been unpublished by a downstream participant.
|
|
317
|
+
*/
|
|
318
|
+
DataTrackUnpublished = "dataTrackUnpublished",
|
|
319
|
+
/**
|
|
320
|
+
* Emits when a new data track has been published locally.
|
|
321
|
+
*/
|
|
322
|
+
LocalDataTrackPublished = "localDataTrackPublished",
|
|
323
|
+
/**
|
|
324
|
+
* Emits when a new data track has been unpublished locally.
|
|
325
|
+
*/
|
|
326
|
+
LocalDataTrackUnpublished = "localDataTrackUnpublished"
|
|
311
327
|
}
|
|
312
328
|
export declare enum ParticipantEvent {
|
|
313
329
|
/**
|
|
@@ -528,7 +544,12 @@ export declare enum EngineEvent {
|
|
|
528
544
|
Offline = "offline",
|
|
529
545
|
SignalRequestResponse = "signalRequestResponse",
|
|
530
546
|
SignalConnected = "signalConnected",
|
|
531
|
-
RoomMoved = "roomMoved"
|
|
547
|
+
RoomMoved = "roomMoved",
|
|
548
|
+
PublishDataTrackResponse = "publishDataTrackResponse",
|
|
549
|
+
UnPublishDataTrackResponse = "unPublishDataTrackResponse",
|
|
550
|
+
DataTrackSubscriberHandles = "dataTrackSubscriberHandles",
|
|
551
|
+
DataTrackPacketReceived = "dataTrackPacketReceived",
|
|
552
|
+
Joined = "joined"
|
|
532
553
|
}
|
|
533
554
|
export declare enum TrackEvent {
|
|
534
555
|
Message = "message",
|
|
@@ -4,6 +4,9 @@ import TypedPromise from '../../utils/TypedPromise';
|
|
|
4
4
|
import type RTCEngine from '../RTCEngine';
|
|
5
5
|
import type OutgoingDataStreamManager from '../data-stream/outgoing/OutgoingDataStreamManager';
|
|
6
6
|
import type { TextStreamWriter } from '../data-stream/outgoing/StreamWriter';
|
|
7
|
+
import LocalDataTrack from '../data-track/LocalDataTrack';
|
|
8
|
+
import type OutgoingDataTrackManager from '../data-track/outgoing/OutgoingDataTrackManager';
|
|
9
|
+
import type { DataTrackOptions } from '../data-track/outgoing/types';
|
|
7
10
|
import type { PerformRpcParams, RpcInvocationData } from '../rpc';
|
|
8
11
|
import { RpcError } from '../rpc';
|
|
9
12
|
import LocalTrack from '../track/LocalTrack';
|
|
@@ -38,12 +41,13 @@ export default class LocalParticipant extends Participant {
|
|
|
38
41
|
private firstActiveAgent?;
|
|
39
42
|
private rpcHandlers;
|
|
40
43
|
private roomOutgoingDataStreamManager;
|
|
44
|
+
private roomOutgoingDataTrackManager;
|
|
41
45
|
private pendingSignalRequests;
|
|
42
46
|
private enabledPublishVideoCodecs;
|
|
43
47
|
private pendingAcks;
|
|
44
48
|
private pendingResponses;
|
|
45
49
|
/** @internal */
|
|
46
|
-
constructor(sid: string, identity: string, engine: RTCEngine, options: InternalRoomOptions, roomRpcHandlers: Map<string, (data: RpcInvocationData) => Promise<string>>, roomOutgoingDataStreamManager: OutgoingDataStreamManager);
|
|
50
|
+
constructor(sid: string, identity: string, engine: RTCEngine, options: InternalRoomOptions, roomRpcHandlers: Map<string, (data: RpcInvocationData) => Promise<string>>, roomOutgoingDataStreamManager: OutgoingDataStreamManager, roomOutgoingDataTrackManager: OutgoingDataTrackManager);
|
|
47
51
|
get lastCameraError(): Error | undefined;
|
|
48
52
|
get lastMicrophoneError(): Error | undefined;
|
|
49
53
|
get isE2EEEnabled(): boolean;
|
|
@@ -261,5 +265,11 @@ export default class LocalParticipant extends Participant {
|
|
|
261
265
|
private handleTrackEnded;
|
|
262
266
|
private getPublicationForTrack;
|
|
263
267
|
private waitForPendingPublicationOfSource;
|
|
268
|
+
/** Publishes a data track.
|
|
269
|
+
*
|
|
270
|
+
* Returns the published data track if successful. Use {@link LocalDataTrack#tryPush}
|
|
271
|
+
* to send data frames on the track.
|
|
272
|
+
*/
|
|
273
|
+
publishDataTrack(options: DataTrackOptions): Promise<LocalDataTrack>;
|
|
264
274
|
}
|
|
265
275
|
//# sourceMappingURL=LocalParticipant.d.ts.map
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ParticipantInfo } from '@livekit/protocol';
|
|
2
2
|
import type { SignalClient } from '../../api/SignalClient';
|
|
3
|
+
import { DeferrableMap } from '../../utils/deferrable-map';
|
|
4
|
+
import type RemoteDataTrack from '../data-track/RemoteDataTrack';
|
|
3
5
|
import RemoteTrackPublication from '../track/RemoteTrackPublication';
|
|
4
6
|
import { Track } from '../track/Track';
|
|
5
7
|
import type { AudioOutputOptions } from '../track/options';
|
|
@@ -11,6 +13,13 @@ export default class RemoteParticipant extends Participant {
|
|
|
11
13
|
audioTrackPublications: Map<string, RemoteTrackPublication>;
|
|
12
14
|
videoTrackPublications: Map<string, RemoteTrackPublication>;
|
|
13
15
|
trackPublications: Map<string, RemoteTrackPublication>;
|
|
16
|
+
/** A map of data track name to the corresponding {@link RemoteDataTrack}.
|
|
17
|
+
* @example
|
|
18
|
+
* // An already existing data track:
|
|
19
|
+
* const track = remoteParticipant.dataTracks.get("data track name");
|
|
20
|
+
* // Wait for a data track which will be published soon:
|
|
21
|
+
* const track = await remoteParticipant.dataTracks.getDeferred("data track name"); */
|
|
22
|
+
dataTracks: DeferrableMap<RemoteDataTrack['info']['name'], RemoteDataTrack>;
|
|
14
23
|
signalClient: SignalClient;
|
|
15
24
|
private volumeMap;
|
|
16
25
|
private audioOutput?;
|
|
@@ -53,6 +62,10 @@ export default class RemoteParticipant extends Participant {
|
|
|
53
62
|
*/
|
|
54
63
|
setAudioOutput(output: AudioOutputOptions): Promise<void>;
|
|
55
64
|
/** @internal */
|
|
65
|
+
addRemoteDataTrack(remoteDataTrack: RemoteDataTrack): void;
|
|
66
|
+
/** @internal */
|
|
67
|
+
removeRemoteDataTrack(remoteDataTrackSid: RemoteDataTrack['info']['sid']): void;
|
|
68
|
+
/** @internal */
|
|
56
69
|
emit<E extends keyof ParticipantEventCallbacks>(event: E, ...args: Parameters<ParticipantEventCallbacks[E]>): boolean;
|
|
57
70
|
}
|
|
58
71
|
//# sourceMappingURL=RemoteParticipant.d.ts.map
|
|
@@ -145,4 +145,5 @@ export declare function isLocalParticipant(p: Participant): p is LocalParticipan
|
|
|
145
145
|
export declare function isRemoteParticipant(p: Participant): p is RemoteParticipant;
|
|
146
146
|
export declare function splitUtf8(s: string, n: number): Uint8Array[];
|
|
147
147
|
export declare function extractMaxAgeFromRequestHeaders(headers: Headers): number | undefined;
|
|
148
|
+
export declare function isCompressionStreamSupported(): boolean;
|
|
148
149
|
//# sourceMappingURL=utils.d.ts.map
|