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,214 +1,273 @@
|
|
|
1
|
-
import { ChatMessage as ChatMessageModel, ClientInfo, ClientInfo_Capability, DisconnectReason, Transcription as TranscriptionModel } from '@livekit/protocol';
|
|
2
|
-
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
3
|
-
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
4
|
-
import TypedPromise from '../utils/TypedPromise';
|
|
5
|
-
import type { BrowserDetails } from '../utils/browserParser';
|
|
6
|
-
import type { ConnectionError } from './errors';
|
|
7
|
-
import type LocalParticipant from './participant/LocalParticipant';
|
|
8
|
-
import type Participant from './participant/Participant';
|
|
9
|
-
import type RemoteParticipant from './participant/RemoteParticipant';
|
|
10
|
-
import type LocalAudioTrack from './track/LocalAudioTrack';
|
|
11
|
-
import type LocalTrack from './track/LocalTrack';
|
|
12
|
-
import type LocalTrackPublication from './track/LocalTrackPublication';
|
|
13
|
-
import type LocalVideoTrack from './track/LocalVideoTrack';
|
|
14
|
-
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
|
15
|
-
import type RemoteTrack from './track/RemoteTrack';
|
|
16
|
-
import type RemoteTrackPublication from './track/RemoteTrackPublication';
|
|
17
|
-
import type RemoteVideoTrack from './track/RemoteVideoTrack';
|
|
18
|
-
import { Track } from './track/Track';
|
|
19
|
-
import type { TrackPublication } from './track/TrackPublication';
|
|
20
|
-
import type { AudioCodec, VideoCodec } from './track/options';
|
|
21
|
-
import type { ChatMessage, TranscriptionSegment } from './types';
|
|
22
|
-
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
|
|
23
|
-
export declare function unpackStreamId(packed: string): string[];
|
|
24
|
-
export declare function sleep(duration: number): TypedPromise<void, never>;
|
|
25
|
-
/** @internal */
|
|
26
|
-
export declare function supportsTransceiver(): boolean;
|
|
27
|
-
/** @internal */
|
|
28
|
-
export declare function supportsAddTrack(): boolean;
|
|
29
|
-
export declare function supportsAdaptiveStream(): boolean;
|
|
30
|
-
export declare function supportsDynacast(): boolean;
|
|
31
|
-
export declare function supportsAV1(): boolean;
|
|
32
|
-
export declare function supportsVP9(): boolean;
|
|
33
|
-
export declare function supportsH265(): boolean;
|
|
34
|
-
export declare function isSVCCodec(codec?: string): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Opts `transceiver` into negotiating the AV1 dependency descriptor, reporting whether it will be.
|
|
37
|
-
*
|
|
38
|
-
* Chrome only offers the extension on transceivers that can send, so one we create to receive on
|
|
39
|
-
* never negotiates it — and Chrome 152 stopped decoding AV1 that arrives without it: frames get
|
|
40
|
-
* assembled, none ever decode, and the receiver asks for a keyframe forever. Asking through the
|
|
41
|
-
* transceiver rather than munging the extension into the SDP leaves the browser owning the
|
|
42
|
-
* extension id, which is what keeps that id consistent across the bundle and across
|
|
43
|
-
* renegotiations.
|
|
44
|
-
*
|
|
45
|
-
* A no-op where the browser offers no such control, or does not know the extension at all.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare function negotiateDependencyDescriptor(transceiver: RTCRtpTransceiver): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* VP9 and AV1 are published as SVC (a single RTP stream carrying every spatial layer)
|
|
51
|
-
* by default. They can instead be published as real, rid based simulcast — one
|
|
52
|
-
* independent stream per rid, each carrying a single spatial layer — when the caller
|
|
53
|
-
* opts in with `simulcast: true` and a single spatial layer scalability mode (`L1Tx`).
|
|
54
|
-
*
|
|
55
|
-
* The SFU has to be told about this: without an explicit
|
|
56
|
-
* `SimulcastCodec.videoLayerMode` it assumes `MULTIPLE_SPATIAL_LAYERS_PER_STREAM` for
|
|
57
|
-
* any SVC capable codec.
|
|
58
|
-
*/
|
|
59
|
-
export declare function isSVCSimulcast(codec?: string, options?: {
|
|
60
|
-
simulcast?: boolean;
|
|
61
|
-
scalabilityMode?: string;
|
|
62
|
-
}): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Whether the browser reads multiple encodings on an SVC capable codec as *legacy SVC*
|
|
65
|
-
* rather than as real simulcast.
|
|
66
|
-
*
|
|
67
|
-
* Before Chrome M113, supplying more than one encoding for VP9/AV1 selected SVC mode;
|
|
68
|
-
* only from M113 does libwebrtc treat such encodings as simulcast, and only when each
|
|
69
|
-
* one carries its own scalabilityMode. Safari (and anything WebKit based, i. e. every
|
|
70
|
-
* browser on iOS) still uses the old interpretation, as does React Native's libwebrtc.
|
|
71
|
-
* Announced at https://groups.google.com/g/discuss-webrtc/c/-QQ3pxrl-fw
|
|
72
|
-
*
|
|
73
|
-
* Where this is true the rids would not exist on the wire, so VP9/AV1 must be published
|
|
74
|
-
* as SVC no matter what the caller asked for.
|
|
75
|
-
*/
|
|
76
|
-
export declare function usesLegacySVCEncodings(): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Whether the connected server honours `SimulcastCodec.videoLayerMode`, i. e. whether
|
|
79
|
-
* VP9/AV1 can be published as rid based simulcast. An unknown version is treated as
|
|
80
|
-
* unsupported so the publish falls back to SVC.
|
|
81
|
-
*/
|
|
82
|
-
export declare function isSVCSimulcastSupportedByServer(serverVersion?: string): boolean;
|
|
83
|
-
export declare function supportsSetSinkId(elm?: HTMLMediaElement): boolean;
|
|
84
|
-
/**
|
|
85
|
-
* Checks whether or not setting an audio output via {@link Room#setActiveDevice}
|
|
86
|
-
* is supported for the current browser.
|
|
87
|
-
*/
|
|
88
|
-
export declare function supportsAudioOutputSelection(): boolean;
|
|
89
|
-
export declare function isBrowserSupported(): boolean;
|
|
90
|
-
export declare function isFireFox(): boolean;
|
|
91
|
-
export declare function isChromiumBased(): boolean;
|
|
92
|
-
export declare function isScriptTransformSupportedForWorker(): boolean;
|
|
93
|
-
export declare function isSafari(): boolean;
|
|
94
|
-
export declare function isSafariBased(): boolean;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
export declare function
|
|
114
|
-
export declare
|
|
115
|
-
export declare
|
|
116
|
-
export
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
export declare function
|
|
121
|
-
export declare function
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
export declare function
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
export declare function
|
|
212
|
-
|
|
213
|
-
export declare function
|
|
214
|
-
|
|
1
|
+
import { ChatMessage as ChatMessageModel, ClientInfo, ClientInfo_Capability, DisconnectReason, Transcription as TranscriptionModel } from '@livekit/protocol';
|
|
2
|
+
import type { Throws } from '@livekit/throws-transformer/throws';
|
|
3
|
+
import type { NonSharedUint8Array } from '../type-polyfills/non-shared-typed-arrays';
|
|
4
|
+
import TypedPromise from '../utils/TypedPromise';
|
|
5
|
+
import type { BrowserDetails } from '../utils/browserParser';
|
|
6
|
+
import type { ConnectionError } from './errors';
|
|
7
|
+
import type LocalParticipant from './participant/LocalParticipant';
|
|
8
|
+
import type Participant from './participant/Participant';
|
|
9
|
+
import type RemoteParticipant from './participant/RemoteParticipant';
|
|
10
|
+
import type LocalAudioTrack from './track/LocalAudioTrack';
|
|
11
|
+
import type LocalTrack from './track/LocalTrack';
|
|
12
|
+
import type LocalTrackPublication from './track/LocalTrackPublication';
|
|
13
|
+
import type LocalVideoTrack from './track/LocalVideoTrack';
|
|
14
|
+
import type RemoteAudioTrack from './track/RemoteAudioTrack';
|
|
15
|
+
import type RemoteTrack from './track/RemoteTrack';
|
|
16
|
+
import type RemoteTrackPublication from './track/RemoteTrackPublication';
|
|
17
|
+
import type RemoteVideoTrack from './track/RemoteVideoTrack';
|
|
18
|
+
import { Track } from './track/Track';
|
|
19
|
+
import type { TrackPublication } from './track/TrackPublication';
|
|
20
|
+
import type { AudioCodec, VideoCodec } from './track/options';
|
|
21
|
+
import type { ChatMessage, TranscriptionSegment } from './types';
|
|
22
|
+
export declare const ddExtensionURI = "https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";
|
|
23
|
+
export declare function unpackStreamId(packed: string): string[];
|
|
24
|
+
export declare function sleep(duration: number): TypedPromise<void, never>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
export declare function supportsTransceiver(): boolean;
|
|
27
|
+
/** @internal */
|
|
28
|
+
export declare function supportsAddTrack(): boolean;
|
|
29
|
+
export declare function supportsAdaptiveStream(): boolean;
|
|
30
|
+
export declare function supportsDynacast(): boolean;
|
|
31
|
+
export declare function supportsAV1(): boolean;
|
|
32
|
+
export declare function supportsVP9(): boolean;
|
|
33
|
+
export declare function supportsH265(): boolean;
|
|
34
|
+
export declare function isSVCCodec(codec?: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Opts `transceiver` into negotiating the AV1 dependency descriptor, reporting whether it will be.
|
|
37
|
+
*
|
|
38
|
+
* Chrome only offers the extension on transceivers that can send, so one we create to receive on
|
|
39
|
+
* never negotiates it — and Chrome 152 stopped decoding AV1 that arrives without it: frames get
|
|
40
|
+
* assembled, none ever decode, and the receiver asks for a keyframe forever. Asking through the
|
|
41
|
+
* transceiver rather than munging the extension into the SDP leaves the browser owning the
|
|
42
|
+
* extension id, which is what keeps that id consistent across the bundle and across
|
|
43
|
+
* renegotiations.
|
|
44
|
+
*
|
|
45
|
+
* A no-op where the browser offers no such control, or does not know the extension at all.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function negotiateDependencyDescriptor(transceiver: RTCRtpTransceiver): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* VP9 and AV1 are published as SVC (a single RTP stream carrying every spatial layer)
|
|
51
|
+
* by default. They can instead be published as real, rid based simulcast — one
|
|
52
|
+
* independent stream per rid, each carrying a single spatial layer — when the caller
|
|
53
|
+
* opts in with `simulcast: true` and a single spatial layer scalability mode (`L1Tx`).
|
|
54
|
+
*
|
|
55
|
+
* The SFU has to be told about this: without an explicit
|
|
56
|
+
* `SimulcastCodec.videoLayerMode` it assumes `MULTIPLE_SPATIAL_LAYERS_PER_STREAM` for
|
|
57
|
+
* any SVC capable codec.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isSVCSimulcast(codec?: string, options?: {
|
|
60
|
+
simulcast?: boolean;
|
|
61
|
+
scalabilityMode?: string;
|
|
62
|
+
}): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the browser reads multiple encodings on an SVC capable codec as *legacy SVC*
|
|
65
|
+
* rather than as real simulcast.
|
|
66
|
+
*
|
|
67
|
+
* Before Chrome M113, supplying more than one encoding for VP9/AV1 selected SVC mode;
|
|
68
|
+
* only from M113 does libwebrtc treat such encodings as simulcast, and only when each
|
|
69
|
+
* one carries its own scalabilityMode. Safari (and anything WebKit based, i. e. every
|
|
70
|
+
* browser on iOS) still uses the old interpretation, as does React Native's libwebrtc.
|
|
71
|
+
* Announced at https://groups.google.com/g/discuss-webrtc/c/-QQ3pxrl-fw
|
|
72
|
+
*
|
|
73
|
+
* Where this is true the rids would not exist on the wire, so VP9/AV1 must be published
|
|
74
|
+
* as SVC no matter what the caller asked for.
|
|
75
|
+
*/
|
|
76
|
+
export declare function usesLegacySVCEncodings(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the connected server honours `SimulcastCodec.videoLayerMode`, i. e. whether
|
|
79
|
+
* VP9/AV1 can be published as rid based simulcast. An unknown version is treated as
|
|
80
|
+
* unsupported so the publish falls back to SVC.
|
|
81
|
+
*/
|
|
82
|
+
export declare function isSVCSimulcastSupportedByServer(serverVersion?: string): boolean;
|
|
83
|
+
export declare function supportsSetSinkId(elm?: HTMLMediaElement): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Checks whether or not setting an audio output via {@link Room#setActiveDevice}
|
|
86
|
+
* is supported for the current browser.
|
|
87
|
+
*/
|
|
88
|
+
export declare function supportsAudioOutputSelection(): boolean;
|
|
89
|
+
export declare function isBrowserSupported(): boolean;
|
|
90
|
+
export declare function isFireFox(): boolean;
|
|
91
|
+
export declare function isChromiumBased(): boolean;
|
|
92
|
+
export declare function isScriptTransformSupportedForWorker(): boolean;
|
|
93
|
+
export declare function isSafari(): boolean;
|
|
94
|
+
export declare function isSafariBased(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* iPadOS has sent the desktop Macintosh user agent by default since iPadOS 13, so `getBrowser()`
|
|
97
|
+
* reports `os: 'macOS'` there and every `os === 'iOS'` check misses it. macOS Safari implements no
|
|
98
|
+
* touch events at all (`TouchEvent` undefined, `maxTouchPoints` 0) regardless of any touchscreen
|
|
99
|
+
* attached, so touch capability separates the two. Measured on an iPad 6 / iPadOS 17
|
|
100
|
+
* (`maxTouchPoints` 5) against macOS Safari 26.4 (`maxTouchPoints` 0).
|
|
101
|
+
*
|
|
102
|
+
* Deliberately a separate helper rather than a fix in `browserParser`: iPadOS spoofs the Mac
|
|
103
|
+
* version too, so reporting `os: 'iOS'` there would leave `osVersion` at `10.15.7` and silently
|
|
104
|
+
* break {@link isSafari17Based} and {@link isSafariSvcApi}, which compare it.
|
|
105
|
+
*/
|
|
106
|
+
export declare function isIPadOS(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* iPhone, iPad and iOS-hosted browsers — everything running the Apple camera capture pipeline,
|
|
109
|
+
* including iPads that present themselves as a Mac.
|
|
110
|
+
*/
|
|
111
|
+
export declare function isAppleMobile(): boolean;
|
|
112
|
+
export declare function isSafari17Based(): boolean;
|
|
113
|
+
export declare function isSafariSvcApi(browser?: BrowserDetails): boolean;
|
|
114
|
+
export declare function isMobile(): boolean;
|
|
115
|
+
export declare function isE2EESimulcastSupported(): boolean | undefined;
|
|
116
|
+
export declare function isWeb(): boolean;
|
|
117
|
+
export declare function isReactNative(): boolean;
|
|
118
|
+
export declare function isCloud(serverUrl: URL): boolean;
|
|
119
|
+
export declare function extractProjectFromUrl(serverUrl: URL): string | null;
|
|
120
|
+
export declare function getReactNativeOs(): string | undefined;
|
|
121
|
+
export declare function getDevicePixelRatio(): number;
|
|
122
|
+
/**
|
|
123
|
+
* @param v1 - The first version string to compare.
|
|
124
|
+
* @param v2 - The second version string to compare.
|
|
125
|
+
* @returns A number indicating the order of the versions:
|
|
126
|
+
* - 1 if v1 is greater than v2
|
|
127
|
+
* - -1 if v1 is less than v2
|
|
128
|
+
* - 0 if v1 and v2 are equal
|
|
129
|
+
*/
|
|
130
|
+
export declare function compareVersions(v1: string, v2: string): number;
|
|
131
|
+
export declare const getResizeObserver: () => ResizeObserver;
|
|
132
|
+
export declare const getIntersectionObserver: () => IntersectionObserver;
|
|
133
|
+
export interface ObservableMediaElement extends HTMLMediaElement {
|
|
134
|
+
handleResize: (entry: ResizeObserverEntry) => void;
|
|
135
|
+
handleVisibilityChanged: (entry: IntersectionObserverEntry) => void;
|
|
136
|
+
}
|
|
137
|
+
export declare function getClientInfo(capabilities?: ClientInfo_Capability[]): ClientInfo;
|
|
138
|
+
export declare function getEmptyVideoStreamTrack(): MediaStreamTrack;
|
|
139
|
+
export declare function createDummyVideoStreamTrack(width?: number, height?: number, enabled?: boolean, paintContent?: boolean): MediaStreamTrack;
|
|
140
|
+
/**
|
|
141
|
+
* Returns a silent audio track, cloned off a shared `AudioContext` created on first use. Hand the
|
|
142
|
+
* clone back to `releaseEmptyAudioStreamTrack` rather than stopping it, so the context can close.
|
|
143
|
+
* A clone that is only stopped stays counted as outstanding, which holds the shared context open
|
|
144
|
+
* for the lifetime of the page.
|
|
145
|
+
*/
|
|
146
|
+
export declare function getEmptyAudioStreamTrack(): MediaStreamTrack;
|
|
147
|
+
/**
|
|
148
|
+
* Stops a track obtained from `getEmptyAudioStreamTrack` and closes the shared `AudioContext`
|
|
149
|
+
* backing it once every track it handed out has been released. Does nothing for a track this
|
|
150
|
+
* module never handed out, or one that has been released already.
|
|
151
|
+
*/
|
|
152
|
+
export declare function releaseEmptyAudioStreamTrack(track: MediaStreamTrack): Promise<void>;
|
|
153
|
+
/** An object that represents a serialized version of a `new Promise((resolve, reject) => {})`
|
|
154
|
+
* constructor. Wait for a promise resolution with `await future.promise` and explicitly resolve or
|
|
155
|
+
* reject the inner promise with `future.resolve(...)` or `future.reject(...)`.
|
|
156
|
+
*/
|
|
157
|
+
export declare class Future<T, E extends Error> {
|
|
158
|
+
promise: Promise<Throws<T, E>>;
|
|
159
|
+
resolve?: (arg: T) => void;
|
|
160
|
+
reject?: (e: E) => void;
|
|
161
|
+
onFinally?: () => void;
|
|
162
|
+
get isResolved(): boolean;
|
|
163
|
+
private _isResolved;
|
|
164
|
+
constructor(futureBase?: (resolve: (arg: T) => void, reject: (e: E) => void) => void, onFinally?: () => void);
|
|
165
|
+
}
|
|
166
|
+
export type AudioAnalyserOptions = {
|
|
167
|
+
/**
|
|
168
|
+
* If set to true, the analyser will use a cloned version of the underlying mediastreamtrack, which won't be impacted by muting the track.
|
|
169
|
+
* Useful for local tracks when implementing things like "seems like you're muted, but trying to speak".
|
|
170
|
+
* Defaults to false
|
|
171
|
+
*/
|
|
172
|
+
cloneTrack?: boolean;
|
|
173
|
+
/**
|
|
174
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/fftSize
|
|
175
|
+
*/
|
|
176
|
+
fftSize?: number;
|
|
177
|
+
/**
|
|
178
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/smoothingTimeConstant
|
|
179
|
+
*/
|
|
180
|
+
smoothingTimeConstant?: number;
|
|
181
|
+
/**
|
|
182
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/minDecibels
|
|
183
|
+
*/
|
|
184
|
+
minDecibels?: number;
|
|
185
|
+
/**
|
|
186
|
+
* see https://developer.mozilla.org/en-US/docs/Web/API/AnalyserNode/maxDecibels
|
|
187
|
+
*/
|
|
188
|
+
maxDecibels?: number;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Creates and returns an analyser web audio node that is attached to the provided track.
|
|
192
|
+
* Additionally returns a convenience method `calculateVolume` to perform instant volume readings on that track.
|
|
193
|
+
* Call the returned `cleanup` function to close the audioContext that has been created for the instance of this helper
|
|
194
|
+
*/
|
|
195
|
+
export declare function createAudioAnalyser(track: LocalAudioTrack | RemoteAudioTrack, options?: AudioAnalyserOptions): {
|
|
196
|
+
calculateVolume: () => number;
|
|
197
|
+
analyser: AnalyserNode;
|
|
198
|
+
cleanup: () => Promise<void>;
|
|
199
|
+
};
|
|
200
|
+
export declare function isAudioCodec(maybeCodec: string): maybeCodec is AudioCodec;
|
|
201
|
+
export declare function isVideoCodec(maybeCodec: string): maybeCodec is VideoCodec;
|
|
202
|
+
export declare function unwrapConstraint(constraint: ConstrainDOMString): string;
|
|
203
|
+
export declare function unwrapConstraint(constraint: ConstrainULong): number;
|
|
204
|
+
/**
|
|
205
|
+
* The getUserMedia rejections that no softer constraint can recover from, because the user or the
|
|
206
|
+
* document refused capture outright. Retrying one of these would put a second prompt in front of
|
|
207
|
+
* someone who already said no. The last two names are legacy spellings still reported by older
|
|
208
|
+
* engines. Matched by `name` rather than with `instanceof`, because these are not reliably distinct
|
|
209
|
+
* constructors across environments. happy-dom, which the tests run under, aliases them to `Event`.
|
|
210
|
+
*/
|
|
211
|
+
export declare function isPermissionDeniedError(e: unknown): boolean;
|
|
212
|
+
/** Records that `e` is the rejection getUserMedia itself produced. */
|
|
213
|
+
export declare function markDeviceAcquisitionFailure(e: unknown): void;
|
|
214
|
+
/**
|
|
215
|
+
* Whether a track restart failed at getUserMedia rather than in the work that adopts the new track.
|
|
216
|
+
* Recorded on the side rather than by wrapping, because callers of `restartTrack` match on the
|
|
217
|
+
* rejection's own name.
|
|
218
|
+
*/
|
|
219
|
+
export declare function isDeviceAcquisitionFailure(e: unknown): boolean;
|
|
220
|
+
export declare function toWebsocketUrl(url: string): string;
|
|
221
|
+
export declare function toHttpUrl(url: string): string;
|
|
222
|
+
export declare function extractTranscriptionSegments(transcription: TranscriptionModel, firstReceivedTimesMap: Map<string, number>): TranscriptionSegment[];
|
|
223
|
+
export declare function extractChatMessage(msg: ChatMessageModel): ChatMessage;
|
|
224
|
+
export declare function getDisconnectReasonFromConnectionError(e: ConnectionError): DisconnectReason;
|
|
225
|
+
/** convert bigints to numbers preserving undefined values */
|
|
226
|
+
export declare function bigIntToNumber<T extends BigInt | undefined>(value: T): T extends BigInt ? number : undefined;
|
|
227
|
+
/** convert numbers to bigints preserving undefined values */
|
|
228
|
+
export declare function numberToBigInt<T extends number | undefined>(value: T): T extends number ? bigint : undefined;
|
|
229
|
+
export declare function isLocalTrack(track: Track | MediaStreamTrack | undefined): track is LocalTrack;
|
|
230
|
+
export declare function isAudioTrack(track: Track | undefined): track is LocalAudioTrack | RemoteAudioTrack;
|
|
231
|
+
export declare function isVideoTrack(track: Track | undefined): track is LocalVideoTrack | RemoteVideoTrack;
|
|
232
|
+
export declare function isLocalVideoTrack(track: Track | MediaStreamTrack | undefined): track is LocalVideoTrack;
|
|
233
|
+
export declare function isLocalAudioTrack(track: Track | MediaStreamTrack | undefined): track is LocalAudioTrack;
|
|
234
|
+
export declare function isRemoteTrack(track: Track | undefined): track is RemoteTrack;
|
|
235
|
+
export declare function isRemotePub(pub: TrackPublication | undefined): pub is RemoteTrackPublication;
|
|
236
|
+
export declare function isLocalPub(pub: TrackPublication | undefined): pub is LocalTrackPublication;
|
|
237
|
+
export declare function isRemoteVideoTrack(track: Track | undefined): track is RemoteVideoTrack;
|
|
238
|
+
export declare function isLocalParticipant(p: Participant): p is LocalParticipant;
|
|
239
|
+
export declare function isRemoteParticipant(p: Participant): p is RemoteParticipant;
|
|
240
|
+
export declare function splitUtf8(s: string, n: number): NonSharedUint8Array[];
|
|
241
|
+
/** Wraps a byte array in a `ReadableStream` that yields it as a single chunk and then closes. */
|
|
242
|
+
export declare function readableFromBytes(bytes: NonSharedUint8Array): ReadableStream<NonSharedUint8Array>;
|
|
243
|
+
/**
|
|
244
|
+
* Re-chunks a byte stream into pieces of exactly `chunkSize` bytes (the final piece may be
|
|
245
|
+
* smaller), coalescing or splitting the source's pieces as needed. Memory use is bounded to roughly
|
|
246
|
+
* `chunkSize` plus one source read, so it never buffers the whole stream — used to pack
|
|
247
|
+
* `CompressionStream`/`file.stream()` output into MTU-sized data-stream chunks.
|
|
248
|
+
*/
|
|
249
|
+
export declare function readBytesInChunks(source: ReadableStream<NonSharedUint8Array>, chunkSize: number): AsyncGenerator<NonSharedUint8Array>;
|
|
250
|
+
/** Encodes a byte array as a base64 string (suitable for embedding binary data in a string field). */
|
|
251
|
+
export declare function encodeBase64(bytes: Uint8Array): string;
|
|
252
|
+
/** Decodes a base64 string (as produced by {@link encodeBase64}) back into a byte array. */
|
|
253
|
+
export declare function decodeBase64(base64: string): Uint8Array;
|
|
254
|
+
export declare function extractMaxAgeFromRequestHeaders(headers: Headers): number | undefined;
|
|
255
|
+
export declare function isCompressionStreamSupported(): boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Whether this runtime can compress AND decompress the `deflate-raw` format, which is a stricter
|
|
258
|
+
* requirement than {@link isCompressionStreamSupported}: Chromium 80-102 included
|
|
259
|
+
* `CompressionStream` supporting only `gzip` / `deflate`, and `deflate-raw` was added in Chromium
|
|
260
|
+
* 103 (Firefox 113, Safari 16.4).
|
|
261
|
+
*/
|
|
262
|
+
export declare function isDeflateRawCompressionSupported(): boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Clears the memoized {@link isDeflateRawCompressionSupported} probe result. A runtime doesn't
|
|
265
|
+
* gain or lose compression formats while it is running, so this only exists for tests that swap
|
|
266
|
+
* the global `CompressionStream` / `DecompressionStream`.
|
|
267
|
+
*
|
|
268
|
+
* @internal
|
|
269
|
+
*/
|
|
270
|
+
export declare function resetDeflateRawCompressionSupportCache(): void;
|
|
271
|
+
export declare function isPublisherOfferWithJoinSupported(): boolean;
|
|
272
|
+
export declare function extractTrackSid(mediaTrack: MediaStreamTrack, stream: MediaStream): Track.SID | undefined;
|
|
273
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export default class MockMediaStreamTrack implements MediaStreamTrack {
|
|
2
|
-
contentHint: string;
|
|
3
|
-
enabled: boolean;
|
|
4
|
-
id: string;
|
|
5
|
-
kind: string;
|
|
6
|
-
label: string;
|
|
7
|
-
muted: boolean;
|
|
8
|
-
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
9
|
-
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
10
|
-
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
11
|
-
readyState: MediaStreamTrackState;
|
|
12
|
-
isolated: boolean;
|
|
13
|
-
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
14
|
-
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
|
|
15
|
-
clone(): MediaStreamTrack;
|
|
16
|
-
getCapabilities(): MediaTrackCapabilities;
|
|
17
|
-
getConstraints(): MediaTrackConstraints;
|
|
18
|
-
getSettings(): MediaTrackSettings;
|
|
19
|
-
stop(): void;
|
|
20
|
-
addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
21
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
22
|
-
removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
23
|
-
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
24
|
-
dispatchEvent(event: Event): boolean;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=MockMediaStreamTrack.d.ts.map
|
|
1
|
+
export default class MockMediaStreamTrack implements MediaStreamTrack {
|
|
2
|
+
contentHint: string;
|
|
3
|
+
enabled: boolean;
|
|
4
|
+
id: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
label: string;
|
|
7
|
+
muted: boolean;
|
|
8
|
+
onended: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
9
|
+
onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
10
|
+
onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
11
|
+
readyState: MediaStreamTrackState;
|
|
12
|
+
isolated: boolean;
|
|
13
|
+
onisolationchange: ((this: MediaStreamTrack, ev: Event) => any) | null;
|
|
14
|
+
applyConstraints(constraints?: MediaTrackConstraints): Promise<void>;
|
|
15
|
+
clone(): MediaStreamTrack;
|
|
16
|
+
getCapabilities(): MediaTrackCapabilities;
|
|
17
|
+
getConstraints(): MediaTrackConstraints;
|
|
18
|
+
getSettings(): MediaTrackSettings;
|
|
19
|
+
stop(): void;
|
|
20
|
+
addEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
21
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
22
|
+
removeEventListener<K extends keyof MediaStreamTrackEventMap>(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
23
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
24
|
+
dispatchEvent(event: Event): boolean;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=MockMediaStreamTrack.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swaps the global `CompressionStream` / `DecompressionStream` away entirely, emulating a runtime
|
|
3
|
+
* that predates the compression streams api. Returns a function that restores them.
|
|
4
|
+
*/
|
|
5
|
+
export declare function stubMissingCompressionStreams(): () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Swaps in global `CompressionStream` / `DecompressionStream` constructors that reject the
|
|
8
|
+
* `deflate-raw` format the way Chromium 80-102 does (the api exists, but only `gzip` / `deflate`
|
|
9
|
+
* are supported). Returns a function that restores the real ones.
|
|
10
|
+
*/
|
|
11
|
+
export declare function stubMissingDeflateRawSupport(): () => void;
|
|
12
|
+
//# sourceMappingURL=compressionStreamStubs.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { MockedClass } from 'vitest';
|
|
2
|
-
import { SignalClient } from '../api/SignalClient';
|
|
3
|
-
import RTCEngine from '../room/RTCEngine';
|
|
4
|
-
declare const mocks: {
|
|
5
|
-
SignalClient: MockedClass<typeof SignalClient>;
|
|
6
|
-
RTCEngine: MockedClass<typeof RTCEngine>;
|
|
7
|
-
MockLocalVideoTrack: {
|
|
8
|
-
stop: () => void;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default mocks;
|
|
12
|
-
//# sourceMappingURL=mocks.d.ts.map
|
|
1
|
+
import type { MockedClass } from 'vitest';
|
|
2
|
+
import { SignalClient } from '../api/SignalClient';
|
|
3
|
+
import RTCEngine from '../room/RTCEngine';
|
|
4
|
+
declare const mocks: {
|
|
5
|
+
SignalClient: MockedClass<typeof SignalClient>;
|
|
6
|
+
RTCEngine: MockedClass<typeof RTCEngine>;
|
|
7
|
+
MockLocalVideoTrack: {
|
|
8
|
+
stop: () => void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default mocks;
|
|
12
|
+
//# sourceMappingURL=mocks.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test helper: resolves `true` if `promise` is still pending after `ms`
|
|
3
|
-
* (default: one macrotask), `false` if it has already settled — regardless of
|
|
4
|
-
* whether it resolved or rejected.
|
|
5
|
-
*
|
|
6
|
-
* Use to assert that something has *not* happened yet (e.g. an onClose callback
|
|
7
|
-
* that must stay silent), optionally within a timeout window. Preferable to
|
|
8
|
-
* `Promise.race([p, Promise.resolve(sentinel)])` when the "not yet" needs to
|
|
9
|
-
* hold for a duration rather than just the current microtask.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isPending(promise: Promise<unknown>, ms?: number): Promise<boolean>;
|
|
12
|
-
//# sourceMappingURL=promiseState.d.ts.map
|
|
1
|
+
/**
|
|
2
|
+
* Test helper: resolves `true` if `promise` is still pending after `ms`
|
|
3
|
+
* (default: one macrotask), `false` if it has already settled — regardless of
|
|
4
|
+
* whether it resolved or rejected.
|
|
5
|
+
*
|
|
6
|
+
* Use to assert that something has *not* happened yet (e.g. an onClose callback
|
|
7
|
+
* that must stay silent), optionally within a timeout window. Preferable to
|
|
8
|
+
* `Promise.race([p, Promise.resolve(sentinel)])` when the "not yet" needs to
|
|
9
|
+
* hold for a duration rather than just the current microtask.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isPending(promise: Promise<unknown>, ms?: number): Promise<boolean>;
|
|
12
|
+
//# sourceMappingURL=promiseState.d.ts.map
|