livekit-client 2.22.2 → 2.22.4

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.
Files changed (245) hide show
  1. package/README.md +35 -0
  2. package/dist/livekit-client.e2ee.worker.js +1 -1
  3. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  4. package/dist/livekit-client.e2ee.worker.mjs +488 -438
  5. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  6. package/dist/livekit-client.esm.mjs +954 -301
  7. package/dist/livekit-client.esm.mjs.map +1 -1
  8. package/dist/livekit-client.fm.worker.js +1 -1
  9. package/dist/livekit-client.fm.worker.js.map +1 -1
  10. package/dist/livekit-client.fm.worker.mjs +10 -2
  11. package/dist/livekit-client.fm.worker.mjs.map +1 -1
  12. package/dist/livekit-client.umd.js +1 -1
  13. package/dist/livekit-client.umd.js.map +1 -1
  14. package/dist/src/api/SignalClient.d.ts +4 -2
  15. package/dist/src/api/SignalClient.d.ts.map +1 -1
  16. package/dist/src/api/WebSocketStream.d.ts.map +1 -1
  17. package/dist/src/api/utils.d.ts +1 -0
  18. package/dist/src/api/utils.d.ts.map +1 -1
  19. package/dist/src/e2ee/E2eeManager.d.ts +26 -0
  20. package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
  21. package/dist/src/e2ee/types.d.ts +15 -1
  22. package/dist/src/e2ee/types.d.ts.map +1 -1
  23. package/dist/src/e2ee/worker/DataCryptor.d.ts.map +1 -1
  24. package/dist/src/e2ee/worker/ErrorRateLimiter.d.ts +21 -0
  25. package/dist/src/e2ee/worker/ErrorRateLimiter.d.ts.map +1 -0
  26. package/dist/src/e2ee/worker/FrameCryptor.d.ts +1 -18
  27. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  28. package/dist/src/logger.d.ts +4 -0
  29. package/dist/src/logger.d.ts.map +1 -1
  30. package/dist/src/options.d.ts +14 -0
  31. package/dist/src/options.d.ts.map +1 -1
  32. package/dist/src/room/PCTransport.d.ts +78 -7
  33. package/dist/src/room/PCTransport.d.ts.map +1 -1
  34. package/dist/src/room/PCTransportManager.d.ts.map +1 -1
  35. package/dist/src/room/RTCEngine.d.ts +9 -0
  36. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  37. package/dist/src/room/Room.d.ts +1 -1
  38. package/dist/src/room/Room.d.ts.map +1 -1
  39. package/dist/src/room/defaults.d.ts.map +1 -1
  40. package/dist/src/room/errors.d.ts +18 -0
  41. package/dist/src/room/errors.d.ts.map +1 -1
  42. package/dist/src/room/events.d.ts +3 -2
  43. package/dist/src/room/events.d.ts.map +1 -1
  44. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  45. package/dist/src/room/participant/publishUtils.d.ts +16 -0
  46. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  47. package/dist/src/room/rpc/client/RpcClientManager.d.ts.map +1 -1
  48. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  49. package/dist/src/room/track/LocalVideoTrack.d.ts +9 -0
  50. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  51. package/dist/src/room/track/options.d.ts +1 -1
  52. package/dist/src/room/track/utils.d.ts +13 -0
  53. package/dist/src/room/track/utils.d.ts.map +1 -1
  54. package/dist/src/room/utils.d.ts +66 -0
  55. package/dist/src/room/utils.d.ts.map +1 -1
  56. package/dist/src/test/compressionStreamStubs.d.ts +12 -0
  57. package/dist/src/test/compressionStreamStubs.d.ts.map +1 -0
  58. package/dist/ts4.2/api/SignalClient.d.ts +187 -185
  59. package/dist/ts4.2/api/SignalClientStateMachine.d.ts +85 -85
  60. package/dist/ts4.2/api/WebSocketStream.d.ts +33 -33
  61. package/dist/ts4.2/api/utils.d.ts +9 -8
  62. package/dist/ts4.2/connectionHelper/ConnectionCheck.d.ts +30 -30
  63. package/dist/ts4.2/connectionHelper/checks/Checker.d.ts +62 -62
  64. package/dist/ts4.2/connectionHelper/checks/cloudRegion.d.ts +18 -18
  65. package/dist/ts4.2/connectionHelper/checks/connectionProtocol.d.ts +20 -20
  66. package/dist/ts4.2/connectionHelper/checks/publishAudio.d.ts +6 -6
  67. package/dist/ts4.2/connectionHelper/checks/publishVideo.d.ts +7 -7
  68. package/dist/ts4.2/connectionHelper/checks/reconnect.d.ts +6 -6
  69. package/dist/ts4.2/connectionHelper/checks/turn.d.ts +6 -6
  70. package/dist/ts4.2/connectionHelper/checks/webrtc.d.ts +6 -6
  71. package/dist/ts4.2/connectionHelper/checks/websocket.d.ts +6 -6
  72. package/dist/ts4.2/e2ee/E2eeManager.d.ts +111 -85
  73. package/dist/ts4.2/e2ee/KeyProvider.d.ts +54 -54
  74. package/dist/ts4.2/e2ee/constants.d.ts +21 -21
  75. package/dist/ts4.2/e2ee/errors.d.ts +12 -12
  76. package/dist/ts4.2/e2ee/events.d.ts +39 -39
  77. package/dist/ts4.2/e2ee/index.d.ts +6 -6
  78. package/dist/ts4.2/e2ee/types.d.ts +231 -217
  79. package/dist/ts4.2/e2ee/utils.d.ts +32 -32
  80. package/dist/ts4.2/e2ee/worker/DataCryptor.d.ts +16 -16
  81. package/dist/ts4.2/e2ee/worker/ErrorRateLimiter.d.ts +21 -0
  82. package/dist/ts4.2/e2ee/worker/FrameCryptor.d.ts +209 -226
  83. package/dist/ts4.2/e2ee/worker/ParticipantKeyHandler.d.ts +81 -84
  84. package/dist/ts4.2/e2ee/worker/e2ee.worker.d.ts +2 -2
  85. package/dist/ts4.2/e2ee/worker/naluUtils.d.ts +28 -28
  86. package/dist/ts4.2/e2ee/worker/sifPayload.d.ts +23 -23
  87. package/dist/ts4.2/frameMetadata/FrameMetadataManager.d.ts +53 -53
  88. package/dist/ts4.2/frameMetadata/frameMetadata.d.ts +33 -33
  89. package/dist/ts4.2/frameMetadata/types.d.ts +62 -62
  90. package/dist/ts4.2/frameMetadata/utils.d.ts +9 -9
  91. package/dist/ts4.2/frameMetadata/worker/frameMetadata.worker.d.ts +2 -2
  92. package/dist/ts4.2/index.d.ts +76 -76
  93. package/dist/ts4.2/logger.d.ts +66 -62
  94. package/dist/ts4.2/options.d.ts +163 -149
  95. package/dist/ts4.2/room/BackOffStrategy.d.ts +27 -27
  96. package/dist/ts4.2/room/DefaultReconnectPolicy.d.ts +8 -8
  97. package/dist/ts4.2/room/DeviceManager.d.ts +12 -12
  98. package/dist/ts4.2/room/PCTransport.d.ts +246 -175
  99. package/dist/ts4.2/room/PCTransportManager.d.ts +77 -77
  100. package/dist/ts4.2/room/RTCEngine.d.ts +269 -261
  101. package/dist/ts4.2/room/ReconnectPolicy.d.ts +24 -24
  102. package/dist/ts4.2/room/RegionUrlProvider.d.ts +36 -36
  103. package/dist/ts4.2/room/Room.d.ts +354 -365
  104. package/dist/ts4.2/room/attribute-typings.d.ts +35 -35
  105. package/dist/ts4.2/room/data-channel/DataChannelManager.d.ts +62 -62
  106. package/dist/ts4.2/room/data-channel/FlowControlledDataChannel.d.ts +94 -95
  107. package/dist/ts4.2/room/data-channel/LossyDataChannel.d.ts +41 -41
  108. package/dist/ts4.2/room/data-channel/ReliableDataChannel.d.ts +57 -57
  109. package/dist/ts4.2/room/data-channel/types.d.ts +12 -12
  110. package/dist/ts4.2/room/data-stream/compression.d.ts +49 -49
  111. package/dist/ts4.2/room/data-stream/constants.d.ts +18 -18
  112. package/dist/ts4.2/room/data-stream/incoming/IncomingDataStreamManager.d.ts +29 -29
  113. package/dist/ts4.2/room/data-stream/incoming/StreamReader.d.ts +80 -80
  114. package/dist/ts4.2/room/data-stream/outgoing/OutgoingDataStreamManager.d.ts +73 -73
  115. package/dist/ts4.2/room/data-stream/outgoing/StreamWriter.d.ts +16 -16
  116. package/dist/ts4.2/room/data-stream/outgoing/header-utils.d.ts +18 -18
  117. package/dist/ts4.2/room/data-track/LocalDataTrack.d.ts +79 -80
  118. package/dist/ts4.2/room/data-track/RemoteDataTrack.d.ts +50 -50
  119. package/dist/ts4.2/room/data-track/depacketizer.d.ts +59 -59
  120. package/dist/ts4.2/room/data-track/frame.d.ts +22 -22
  121. package/dist/ts4.2/room/data-track/handle.d.ts +27 -27
  122. package/dist/ts4.2/room/data-track/incoming/IncomingDataTrackManager.d.ts +124 -124
  123. package/dist/ts4.2/room/data-track/incoming/errors.d.ts +24 -24
  124. package/dist/ts4.2/room/data-track/incoming/pipeline.d.ts +41 -41
  125. package/dist/ts4.2/room/data-track/incoming/types.d.ts +20 -20
  126. package/dist/ts4.2/room/data-track/outgoing/OutgoingDataTrackManager.d.ts +126 -126
  127. package/dist/ts4.2/room/data-track/outgoing/errors.d.ts +74 -74
  128. package/dist/ts4.2/room/data-track/outgoing/pipeline.d.ts +23 -23
  129. package/dist/ts4.2/room/data-track/outgoing/types.d.ts +48 -48
  130. package/dist/ts4.2/room/data-track/packet/constants.d.ts +20 -20
  131. package/dist/ts4.2/room/data-track/packet/errors.d.ts +40 -40
  132. package/dist/ts4.2/room/data-track/packet/extensions.d.ts +69 -69
  133. package/dist/ts4.2/room/data-track/packet/index.d.ts +98 -98
  134. package/dist/ts4.2/room/data-track/packet/serializable.d.ts +13 -13
  135. package/dist/ts4.2/room/data-track/packetizer.d.ts +43 -43
  136. package/dist/ts4.2/room/data-track/track-interfaces.d.ts +23 -23
  137. package/dist/ts4.2/room/data-track/types.d.ts +22 -22
  138. package/dist/ts4.2/room/data-track/utils.d.ts +60 -60
  139. package/dist/ts4.2/room/debounce.d.ts +11 -11
  140. package/dist/ts4.2/room/defaults.d.ts +9 -9
  141. package/dist/ts4.2/room/errors.d.ts +180 -162
  142. package/dist/ts4.2/room/events.d.ts +638 -637
  143. package/dist/ts4.2/room/participant/LocalParticipant.d.ts +287 -287
  144. package/dist/ts4.2/room/participant/Participant.d.ts +142 -144
  145. package/dist/ts4.2/room/participant/ParticipantTrackPermission.d.ts +26 -26
  146. package/dist/ts4.2/room/participant/RemoteParticipant.d.ts +85 -86
  147. package/dist/ts4.2/room/participant/publishUtils.d.ts +53 -37
  148. package/dist/ts4.2/room/rpc/client/RpcClientManager.d.ts +43 -43
  149. package/dist/ts4.2/room/rpc/client/events.d.ts +8 -8
  150. package/dist/ts4.2/room/rpc/index.d.ts +7 -7
  151. package/dist/ts4.2/room/rpc/server/RpcServerManager.d.ts +44 -44
  152. package/dist/ts4.2/room/rpc/server/events.d.ts +8 -8
  153. package/dist/ts4.2/room/rpc/utils.d.ts +131 -131
  154. package/dist/ts4.2/room/stats.d.ts +71 -71
  155. package/dist/ts4.2/room/statsSummary.d.ts +13 -13
  156. package/dist/ts4.2/room/timers.d.ts +12 -12
  157. package/dist/ts4.2/room/token-source/TokenSource.d.ts +82 -82
  158. package/dist/ts4.2/room/token-source/types.d.ts +70 -70
  159. package/dist/ts4.2/room/token-source/utils.d.ts +8 -8
  160. package/dist/ts4.2/room/track/FrameMetadataExtractor.d.ts +19 -19
  161. package/dist/ts4.2/room/track/LocalAudioTrack.d.ts +39 -42
  162. package/dist/ts4.2/room/track/LocalTrack.d.ts +125 -125
  163. package/dist/ts4.2/room/track/LocalTrackPublication.d.ts +42 -42
  164. package/dist/ts4.2/room/track/LocalVideoTrack.d.ts +102 -93
  165. package/dist/ts4.2/room/track/RemoteAudioTrack.d.ts +55 -55
  166. package/dist/ts4.2/room/track/RemoteTrack.d.ts +38 -38
  167. package/dist/ts4.2/room/track/RemoteTrackPublication.d.ts +72 -75
  168. package/dist/ts4.2/room/track/RemoteVideoTrack.d.ts +73 -76
  169. package/dist/ts4.2/room/track/Track.d.ts +156 -166
  170. package/dist/ts4.2/room/track/TrackPublication.d.ts +75 -81
  171. package/dist/ts4.2/room/track/create.d.ts +25 -25
  172. package/dist/ts4.2/room/track/facingMode.d.ts +41 -41
  173. package/dist/ts4.2/room/track/options.d.ts +403 -403
  174. package/dist/ts4.2/room/track/processor/types.d.ts +31 -31
  175. package/dist/ts4.2/room/track/record.d.ts +13 -13
  176. package/dist/ts4.2/room/track/types.d.ts +28 -28
  177. package/dist/ts4.2/room/track/utils.d.ts +60 -47
  178. package/dist/ts4.2/room/types.d.ts +127 -127
  179. package/dist/ts4.2/room/utils.d.ts +246 -180
  180. package/dist/ts4.2/test/MockMediaStreamTrack.d.ts +26 -26
  181. package/dist/ts4.2/test/compressionStreamStubs.d.ts +12 -0
  182. package/dist/ts4.2/test/mocks.d.ts +12 -12
  183. package/dist/ts4.2/test/promiseState.d.ts +12 -12
  184. package/dist/ts4.2/test/signalToken.d.ts +26 -26
  185. package/dist/ts4.2/type-polyfills/non-shared-typed-arrays.d.ts +2 -2
  186. package/dist/ts4.2/utils/AsyncQueue.d.ts +23 -23
  187. package/dist/ts4.2/utils/TypedPromise.d.ts +17 -17
  188. package/dist/ts4.2/utils/abort-signal-polyfill.d.ts +13 -13
  189. package/dist/ts4.2/utils/browserParser.d.ts +13 -13
  190. package/dist/ts4.2/utils/camelToSnakeCase.d.ts +8 -8
  191. package/dist/ts4.2/utils/cloneDeep.d.ts +2 -2
  192. package/dist/ts4.2/utils/dataPacketBuffer.d.ts +34 -34
  193. package/dist/ts4.2/utils/deferrable-map.d.ts +32 -32
  194. package/dist/ts4.2/utils/machineInspector.d.ts +54 -54
  195. package/dist/ts4.2/utils/serializer.d.ts +48 -48
  196. package/dist/ts4.2/utils/subscribeToEvents.d.ts +15 -15
  197. package/dist/ts4.2/utils/ttlmap.d.ts +20 -20
  198. package/dist/ts4.2/version.d.ts +15 -15
  199. package/package.json +5 -4
  200. package/src/api/SignalClient.e2e.test.ts +1 -3
  201. package/src/api/SignalClient.test.ts +160 -10
  202. package/src/api/SignalClient.ts +75 -54
  203. package/src/api/WebSocketStream.ts +3 -8
  204. package/src/api/utils.ts +10 -0
  205. package/src/e2ee/E2eeManager.test.ts +196 -0
  206. package/src/e2ee/E2eeManager.ts +114 -19
  207. package/src/e2ee/types.ts +19 -1
  208. package/src/e2ee/worker/DataCryptor.ts +2 -1
  209. package/src/e2ee/worker/ErrorRateLimiter.test.ts +53 -0
  210. package/src/e2ee/worker/ErrorRateLimiter.ts +52 -0
  211. package/src/e2ee/worker/FrameCryptor.ts +20 -70
  212. package/src/e2ee/worker/e2ee.worker.ts +34 -11
  213. package/src/logger.ts +22 -0
  214. package/src/options.ts +16 -0
  215. package/src/room/PCTransport.test.ts +183 -7
  216. package/src/room/PCTransport.ts +197 -36
  217. package/src/room/PCTransportManager.ts +3 -1
  218. package/src/room/RTCEngine.test.ts +84 -0
  219. package/src/room/RTCEngine.ts +52 -12
  220. package/src/room/Room.test.ts +32 -6
  221. package/src/room/Room.ts +27 -7
  222. package/src/room/data-stream/incoming/IncomingDataStreamManager.test.ts +16 -20
  223. package/src/room/data-stream/incoming/IncomingDataStreamManager.ts +5 -5
  224. package/src/room/data-stream/outgoing/OutgoingDataStreamManager.test.ts +60 -39
  225. package/src/room/data-stream/outgoing/OutgoingDataStreamManager.ts +4 -4
  226. package/src/room/defaults.ts +1 -0
  227. package/src/room/errors.test.ts +36 -0
  228. package/src/room/errors.ts +27 -0
  229. package/src/room/events.ts +2 -1
  230. package/src/room/participant/LocalParticipant.ts +30 -14
  231. package/src/room/participant/publishUtils.test.ts +133 -0
  232. package/src/room/participant/publishUtils.ts +54 -38
  233. package/src/room/rpc/client/RpcClientManager.test.ts +51 -0
  234. package/src/room/rpc/client/RpcClientManager.ts +32 -15
  235. package/src/room/track/LocalTrack.ts +18 -7
  236. package/src/room/track/LocalVideoTrack.ts +25 -8
  237. package/src/room/track/RemoteAudioTrack.ts +3 -3
  238. package/src/room/track/RemoteVideoTrack.test.ts +210 -0
  239. package/src/room/track/RemoteVideoTrack.ts +29 -3
  240. package/src/room/track/options.ts +1 -1
  241. package/src/room/track/utils.test.ts +201 -2
  242. package/src/room/track/utils.ts +88 -0
  243. package/src/room/utils.test.ts +211 -0
  244. package/src/room/utils.ts +129 -0
  245. package/src/test/compressionStreamStubs.ts +53 -0
@@ -1,31 +1,31 @@
1
- import type Room from '../../Room';
2
- import type LocalTrack from '../LocalTrack';
3
- import type { Track } from '../Track';
4
- /**
5
- * @experimental
6
- */
7
- export type ProcessorOptions<T extends Track.Kind> = {
8
- kind: T;
9
- track: MediaStreamTrack;
10
- element?: HTMLMediaElement;
11
- audioContext?: AudioContext;
12
- localTrack?: LocalTrack;
13
- };
14
- export interface AudioProcessorOptions extends ProcessorOptions<Track.Kind.Audio> {
15
- audioContext: AudioContext;
16
- }
17
- /**
18
- * @experimental
19
- */
20
- export interface VideoProcessorOptions extends ProcessorOptions<Track.Kind.Video> {
21
- }
22
- export interface TrackProcessor<T extends Track.Kind, U extends ProcessorOptions<T> = ProcessorOptions<T>> {
23
- name: string;
24
- init: (opts: U) => Promise<void>;
25
- restart: (opts: U) => Promise<void>;
26
- destroy: () => Promise<void>;
27
- processedTrack?: MediaStreamTrack;
28
- onPublish?: (room: Room) => Promise<void>;
29
- onUnpublish?: () => Promise<void>;
30
- }
31
- //# sourceMappingURL=types.d.ts.map
1
+ import type Room from '../../Room';
2
+ import type LocalTrack from '../LocalTrack';
3
+ import type { Track } from '../Track';
4
+ /**
5
+ * @experimental
6
+ */
7
+ export type ProcessorOptions<T extends Track.Kind> = {
8
+ kind: T;
9
+ track: MediaStreamTrack;
10
+ element?: HTMLMediaElement;
11
+ audioContext?: AudioContext;
12
+ localTrack?: LocalTrack;
13
+ };
14
+ export interface AudioProcessorOptions extends ProcessorOptions<Track.Kind.Audio> {
15
+ audioContext: AudioContext;
16
+ }
17
+ /**
18
+ * @experimental
19
+ */
20
+ export interface VideoProcessorOptions extends ProcessorOptions<Track.Kind.Video> {
21
+ }
22
+ export interface TrackProcessor<T extends Track.Kind, U extends ProcessorOptions<T> = ProcessorOptions<T>> {
23
+ name: string;
24
+ init: (opts: U) => Promise<void>;
25
+ restart: (opts: U) => Promise<void>;
26
+ destroy: () => Promise<void>;
27
+ processedTrack?: MediaStreamTrack;
28
+ onPublish?: (room: Room) => Promise<void>;
29
+ onUnpublish?: () => Promise<void>;
30
+ }
31
+ //# sourceMappingURL=types.d.ts.map
@@ -1,13 +1,13 @@
1
- import type LocalTrack from './LocalTrack';
2
- declare const RecorderBase: {
3
- new (stream: MediaStream, options?: MediaRecorderOptions): MediaRecorder;
4
- prototype: MediaRecorder;
5
- isTypeSupported(type: string): boolean;
6
- };
7
- export declare class LocalTrackRecorder<T extends LocalTrack> extends RecorderBase {
8
- byteStream: ReadableStream<Uint8Array>;
9
- constructor(track: T, options?: MediaRecorderOptions);
10
- }
11
- export declare function isRecordingSupported(): boolean;
12
- export {};
13
- //# sourceMappingURL=record.d.ts.map
1
+ import type LocalTrack from './LocalTrack';
2
+ declare const RecorderBase: {
3
+ new (stream: MediaStream, options?: MediaRecorderOptions): MediaRecorder;
4
+ prototype: MediaRecorder;
5
+ isTypeSupported(type: string): boolean;
6
+ };
7
+ export declare class LocalTrackRecorder<T extends LocalTrack> extends RecorderBase {
8
+ byteStream: ReadableStream<Uint8Array>;
9
+ constructor(track: T, options?: MediaRecorderOptions);
10
+ }
11
+ export declare function isRecordingSupported(): boolean;
12
+ export {};
13
+ //# sourceMappingURL=record.d.ts.map
@@ -1,28 +1,28 @@
1
- import type LocalAudioTrack from './LocalAudioTrack';
2
- import type LocalVideoTrack from './LocalVideoTrack';
3
- import type RemoteAudioTrack from './RemoteAudioTrack';
4
- import type RemoteVideoTrack from './RemoteVideoTrack';
5
- export type AudioTrack = RemoteAudioTrack | LocalAudioTrack;
6
- export type VideoTrack = RemoteVideoTrack | LocalVideoTrack;
7
- export type AdaptiveStreamSettings = {
8
- /**
9
- * Set a custom pixel density. Defaults to 2 for high density screens (3+) or
10
- * 1 otherwise.
11
- * When streaming videos on a ultra high definition screen this setting
12
- * let's you account for the devicePixelRatio of those screens.
13
- * Set it to `screen` to use the actual pixel density of the screen
14
- * Note: this might significantly increase the bandwidth consumed by people
15
- * streaming on high definition screens.
16
- */
17
- pixelDensity?: number | 'screen';
18
- /**
19
- * If true, video gets paused when switching to another tab.
20
- * Defaults to true.
21
- */
22
- pauseVideoInBackground?: boolean;
23
- };
24
- export interface ReplaceTrackOptions {
25
- userProvidedTrack?: boolean;
26
- stopProcessor?: boolean;
27
- }
28
- //# sourceMappingURL=types.d.ts.map
1
+ import type LocalAudioTrack from './LocalAudioTrack';
2
+ import type LocalVideoTrack from './LocalVideoTrack';
3
+ import type RemoteAudioTrack from './RemoteAudioTrack';
4
+ import type RemoteVideoTrack from './RemoteVideoTrack';
5
+ export type AudioTrack = RemoteAudioTrack | LocalAudioTrack;
6
+ export type VideoTrack = RemoteVideoTrack | LocalVideoTrack;
7
+ export type AdaptiveStreamSettings = {
8
+ /**
9
+ * Set a custom pixel density. Defaults to 2 for high density screens (3+) or
10
+ * 1 otherwise.
11
+ * When streaming videos on a ultra high definition screen this setting
12
+ * let's you account for the devicePixelRatio of those screens.
13
+ * Set it to `screen` to use the actual pixel density of the screen
14
+ * Note: this might significantly increase the bandwidth consumed by people
15
+ * streaming on high definition screens.
16
+ */
17
+ pixelDensity?: number | 'screen';
18
+ /**
19
+ * If true, video gets paused when switching to another tab.
20
+ * Defaults to true.
21
+ */
22
+ pauseVideoInBackground?: boolean;
23
+ };
24
+ export interface ReplaceTrackOptions {
25
+ userProvidedTrack?: boolean;
26
+ stopProcessor?: boolean;
27
+ }
28
+ //# sourceMappingURL=types.d.ts.map
@@ -1,47 +1,60 @@
1
- import { TrackInfo, TrackPublishedResponse, TrackSource, VideoQuality } from '@livekit/protocol';
2
- import type { AudioProcessorOptions, TrackProcessor, VideoProcessorOptions } from '../..';
3
- import { Track } from './Track';
4
- import type { TrackPublication } from './TrackPublication';
5
- import type { AudioCaptureOptions, CreateLocalTracksOptions, ScreenShareCaptureOptions, VideoCaptureOptions, VideoCodec } from './options';
6
- import type { AudioTrack } from './types';
7
- export declare function mergeDefaultOptions(options?: CreateLocalTracksOptions, audioDefaults?: AudioCaptureOptions, videoDefaults?: VideoCaptureOptions): CreateLocalTracksOptions;
8
- export declare function constraintsForOptions(options: CreateLocalTracksOptions): MediaStreamConstraints;
9
- /**
10
- * This function detects silence on a given [[Track]] instance.
11
- * Returns true if the track seems to be entirely silent.
12
- */
13
- export declare function detectSilence(track: AudioTrack, timeOffset?: number): Promise<boolean>;
14
- /**
15
- * @internal
16
- */
17
- export declare function getNewAudioContext(): AudioContext | void;
18
- /**
19
- * @internal
20
- */
21
- export declare function kindToSource(kind: MediaDeviceKind): Track.Source.Camera | Track.Source.Microphone | Track.Source.Unknown;
22
- /**
23
- * @internal
24
- */
25
- export declare function sourceToKind(source: Track.Source): MediaDeviceKind | undefined;
26
- /**
27
- * @internal
28
- */
29
- export declare function screenCaptureToDisplayMediaStreamOptions(options: ScreenShareCaptureOptions): DisplayMediaStreamOptions;
30
- export declare function mimeTypeToVideoCodecString(mimeType: string): VideoCodec;
31
- export declare function getTrackPublicationInfo<T extends TrackPublication>(tracks: T[]): TrackPublishedResponse[];
32
- export declare function getLogContextFromTrack(track: Track | TrackPublication): Record<string, unknown>;
33
- export declare function supportsSynchronizationSources(): boolean;
34
- export declare function diffAttributes(oldValues: Record<string, string> | undefined, newValues: Record<string, string> | undefined): Record<string, string>;
35
- /** @internal */
36
- export declare function extractProcessorsFromOptions(options: CreateLocalTracksOptions): {
37
- audioProcessor: TrackProcessor<Track.Kind.Audio, AudioProcessorOptions> | undefined;
38
- videoProcessor: TrackProcessor<Track.Kind.Video, VideoProcessorOptions> | undefined;
39
- optionsWithoutProcessor: {
40
- audio?: boolean | AudioCaptureOptions;
41
- video?: boolean | VideoCaptureOptions;
42
- };
43
- };
44
- export declare function getTrackSourceFromProto(source: TrackSource): Track.Source;
45
- export declare function areDimensionsSmaller(a: Track.Dimensions, b: Track.Dimensions): boolean;
46
- export declare function layerDimensionsFor(trackInfo: TrackInfo, quality: VideoQuality): Track.Dimensions | undefined;
47
- //# sourceMappingURL=utils.d.ts.map
1
+ import { TrackInfo, TrackPublishedResponse, TrackSource, VideoQuality } from '@livekit/protocol';
2
+ import type { AudioProcessorOptions, TrackProcessor, VideoProcessorOptions } from '../..';
3
+ import { Track } from './Track';
4
+ import type { TrackPublication } from './TrackPublication';
5
+ import type { AudioCaptureOptions, CreateLocalTracksOptions, ScreenShareCaptureOptions, VideoCaptureOptions, VideoCodec } from './options';
6
+ import type { AudioTrack } from './types';
7
+ export declare function mergeDefaultOptions(options?: CreateLocalTracksOptions, audioDefaults?: AudioCaptureOptions, videoDefaults?: VideoCaptureOptions): CreateLocalTracksOptions;
8
+ export declare function constraintsForOptions(options: CreateLocalTracksOptions): MediaStreamConstraints;
9
+ /**
10
+ * This function detects silence on a given [[Track]] instance.
11
+ * Returns true if the track seems to be entirely silent.
12
+ */
13
+ export declare function detectSilence(track: AudioTrack, timeOffset?: number): Promise<boolean>;
14
+ /**
15
+ * @internal
16
+ */
17
+ export declare function getNewAudioContext(): AudioContext | void;
18
+ /**
19
+ * @internal
20
+ */
21
+ export declare function kindToSource(kind: MediaDeviceKind): Track.Source.Camera | Track.Source.Microphone | Track.Source.Unknown;
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare function sourceToKind(source: Track.Source): MediaDeviceKind | undefined;
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare function screenCaptureToDisplayMediaStreamOptions(options: ScreenShareCaptureOptions): DisplayMediaStreamOptions;
30
+ export declare function mimeTypeToVideoCodecString(mimeType: string): VideoCodec;
31
+ export declare function getTrackPublicationInfo<T extends TrackPublication>(tracks: T[]): TrackPublishedResponse[];
32
+ export declare function getLogContextFromTrack(track: Track | TrackPublication): Record<string, unknown>;
33
+ export declare function supportsSynchronizationSources(): boolean;
34
+ export declare function diffAttributes(oldValues: Record<string, string> | undefined, newValues: Record<string, string> | undefined): Record<string, string>;
35
+ /** @internal */
36
+ export declare function extractProcessorsFromOptions(options: CreateLocalTracksOptions): {
37
+ audioProcessor: TrackProcessor<Track.Kind.Audio, AudioProcessorOptions> | undefined;
38
+ videoProcessor: TrackProcessor<Track.Kind.Video, VideoProcessorOptions> | undefined;
39
+ optionsWithoutProcessor: {
40
+ audio?: boolean | AudioCaptureOptions;
41
+ video?: boolean | VideoCaptureOptions;
42
+ };
43
+ };
44
+ export declare function getTrackSourceFromProto(source: TrackSource): Track.Source;
45
+ export declare function areDimensionsSmaller(a: Track.Dimensions, b: Track.Dimensions): boolean;
46
+ export declare function layerDimensionsFor(trackInfo: TrackInfo, quality: VideoQuality): Track.Dimensions | undefined;
47
+ /**
48
+ * Waits until `track` has actually produced a video frame.
49
+ *
50
+ * iOS keeps reporting the camera's sensor frame from `getSettings()` until the camera has
51
+ * delivered its first picture, so a portrait capture initially reads as landscape. The arrival
52
+ * of that first frame is the only reliable signal that the reported settings describe reality.
53
+ *
54
+ * Best effort, never throws. Resolves `true` when a frame was observed, `false` when no frame
55
+ * can be observed (the track is already ended, muted or disabled) or `timeoutMs` elapsed first.
56
+ *
57
+ * @internal
58
+ */
59
+ export declare function waitForFirstVideoFrame(track: MediaStreamTrack, timeoutMs: number, candidateElements?: HTMLMediaElement[]): Promise<boolean>;
60
+ //# sourceMappingURL=utils.d.ts.map
@@ -1,127 +1,127 @@
1
- import type { DataStream_Chunk, Encryption_Type } from '@livekit/protocol';
2
- export type SimulationOptions = {
3
- publish?: {
4
- audio?: boolean;
5
- video?: boolean;
6
- useRealTracks?: boolean;
7
- };
8
- participants?: {
9
- count?: number;
10
- aspectRatios?: Array<number>;
11
- audio?: boolean;
12
- video?: boolean;
13
- };
14
- };
15
- export interface SendTextOptions {
16
- topic?: string;
17
- destinationIdentities?: Array<string>;
18
- attachments?: Array<File>;
19
- onProgress?: (progress: number) => void;
20
- attributes?: Record<string, string>;
21
- /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
22
- * when every recipient supports data streams v2 and the runtime can compress. */
23
- compress?: boolean;
24
- }
25
- export interface SendBytesOptions {
26
- topic?: string;
27
- destinationIdentities?: Array<string>;
28
- attributes?: Record<string, string>;
29
- onProgress?: (progress: number) => void;
30
- /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
31
- * when every recipient supports data streams v2 and the runtime can compress. */
32
- compress?: boolean;
33
- name?: string;
34
- mimeType?: string;
35
- }
36
- export interface StreamTextOptions {
37
- topic?: string;
38
- destinationIdentities?: Array<string>;
39
- type?: 'create' | 'update';
40
- streamId?: string;
41
- version?: number;
42
- attachedStreamIds?: Array<string>;
43
- replyToStreamId?: string;
44
- totalSize?: number;
45
- attributes?: Record<string, string>;
46
- }
47
- export type StreamBytesOptions = {
48
- name?: string;
49
- topic?: string;
50
- attributes?: Record<string, string>;
51
- destinationIdentities?: Array<string>;
52
- streamId?: string;
53
- mimeType?: string;
54
- totalSize?: number;
55
- };
56
- export type SendFileOptions = Pick<StreamBytesOptions, 'topic' | 'mimeType' | 'destinationIdentities'> & {
57
- onProgress?: (progress: number) => void;
58
- encryptionType?: Encryption_Type.NONE;
59
- /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
60
- * when every recipient supports data streams v2 and the runtime can compress. */
61
- compress?: boolean;
62
- };
63
- export type DataPublishOptions = {
64
- /**
65
- * whether to send this as reliable or lossy.
66
- * For data that you need delivery guarantee (such as chat messages), use Reliable.
67
- * For data that should arrive as quickly as possible, but you are ok with dropped
68
- * packets, use Lossy.
69
- */
70
- reliable?: boolean;
71
- /**
72
- * the identities of participants who will receive the message, will be sent to every one if empty
73
- */
74
- destinationIdentities?: string[];
75
- /** the topic under which the message gets published */
76
- topic?: string;
77
- };
78
- export type LiveKitReactNativeInfo = {
79
- platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native';
80
- devicePixelRatio: number;
81
- };
82
- export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect' | 'subscriber-bandwidth' | 'disconnect-signal-on-resume' | 'disconnect-signal-on-resume-no-messages' | 'leave-full-reconnect' | 'fail-on-v1-path';
83
- export type LoggerOptions = {
84
- loggerName?: string;
85
- loggerContextCb?: () => Record<string, unknown>;
86
- };
87
- export interface TranscriptionSegment {
88
- id: string;
89
- text: string;
90
- language: string;
91
- startTime: number;
92
- endTime: number;
93
- final: boolean;
94
- firstReceivedTime: number;
95
- lastReceivedTime: number;
96
- }
97
- export interface ChatMessage {
98
- id: string;
99
- timestamp: number;
100
- message: string;
101
- editTimestamp?: number;
102
- attachedFiles?: Array<File>;
103
- }
104
- export interface StreamController<T extends DataStream_Chunk> {
105
- info: BaseStreamInfo;
106
- controller: ReadableStreamDefaultController<T>;
107
- startTime: number;
108
- endTime?: number;
109
- sendingParticipantIdentity: string;
110
- }
111
- export interface BaseStreamInfo {
112
- id: string;
113
- mimeType: string;
114
- topic: string;
115
- timestamp: number;
116
- /** total size in bytes for finite streams and undefined for streams of unknown size */
117
- size?: number;
118
- attributes?: Record<string, string>;
119
- encryptionType: Encryption_Type;
120
- }
121
- export interface ByteStreamInfo extends BaseStreamInfo {
122
- name: string;
123
- }
124
- export interface TextStreamInfo extends BaseStreamInfo {
125
- attachedStreamIds?: Array<string>;
126
- }
127
- //# sourceMappingURL=types.d.ts.map
1
+ import type { DataStream_Chunk, Encryption_Type } from '@livekit/protocol';
2
+ export type SimulationOptions = {
3
+ publish?: {
4
+ audio?: boolean;
5
+ video?: boolean;
6
+ useRealTracks?: boolean;
7
+ };
8
+ participants?: {
9
+ count?: number;
10
+ aspectRatios?: Array<number>;
11
+ audio?: boolean;
12
+ video?: boolean;
13
+ };
14
+ };
15
+ export interface SendTextOptions {
16
+ topic?: string;
17
+ destinationIdentities?: Array<string>;
18
+ attachments?: Array<File>;
19
+ onProgress?: (progress: number) => void;
20
+ attributes?: Record<string, string>;
21
+ /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
22
+ * when every recipient supports data streams v2 and the runtime can compress. */
23
+ compress?: boolean;
24
+ }
25
+ export interface SendBytesOptions {
26
+ topic?: string;
27
+ destinationIdentities?: Array<string>;
28
+ attributes?: Record<string, string>;
29
+ onProgress?: (progress: number) => void;
30
+ /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
31
+ * when every recipient supports data streams v2 and the runtime can compress. */
32
+ compress?: boolean;
33
+ name?: string;
34
+ mimeType?: string;
35
+ }
36
+ export interface StreamTextOptions {
37
+ topic?: string;
38
+ destinationIdentities?: Array<string>;
39
+ type?: 'create' | 'update';
40
+ streamId?: string;
41
+ version?: number;
42
+ attachedStreamIds?: Array<string>;
43
+ replyToStreamId?: string;
44
+ totalSize?: number;
45
+ attributes?: Record<string, string>;
46
+ }
47
+ export type StreamBytesOptions = {
48
+ name?: string;
49
+ topic?: string;
50
+ attributes?: Record<string, string>;
51
+ destinationIdentities?: Array<string>;
52
+ streamId?: string;
53
+ mimeType?: string;
54
+ totalSize?: number;
55
+ };
56
+ export type SendFileOptions = Pick<StreamBytesOptions, 'topic' | 'mimeType' | 'destinationIdentities'> & {
57
+ onProgress?: (progress: number) => void;
58
+ encryptionType?: Encryption_Type.NONE;
59
+ /** Whether to compress the payload (deflate-raw). Defaults to true. Compression is only applied
60
+ * when every recipient supports data streams v2 and the runtime can compress. */
61
+ compress?: boolean;
62
+ };
63
+ export type DataPublishOptions = {
64
+ /**
65
+ * whether to send this as reliable or lossy.
66
+ * For data that you need delivery guarantee (such as chat messages), use Reliable.
67
+ * For data that should arrive as quickly as possible, but you are ok with dropped
68
+ * packets, use Lossy.
69
+ */
70
+ reliable?: boolean;
71
+ /**
72
+ * the identities of participants who will receive the message, will be sent to every one if empty
73
+ */
74
+ destinationIdentities?: string[];
75
+ /** the topic under which the message gets published */
76
+ topic?: string;
77
+ };
78
+ export type LiveKitReactNativeInfo = {
79
+ platform: 'ios' | 'android' | 'windows' | 'macos' | 'web' | 'native';
80
+ devicePixelRatio: number;
81
+ };
82
+ export type SimulationScenario = 'signal-reconnect' | 'speaker' | 'node-failure' | 'server-leave' | 'migration' | 'resume-reconnect' | 'force-tcp' | 'force-tls' | 'full-reconnect' | 'subscriber-bandwidth' | 'disconnect-signal-on-resume' | 'disconnect-signal-on-resume-no-messages' | 'leave-full-reconnect' | 'fail-on-v1-path';
83
+ export type LoggerOptions = {
84
+ loggerName?: string;
85
+ loggerContextCb?: () => Record<string, unknown>;
86
+ };
87
+ export interface TranscriptionSegment {
88
+ id: string;
89
+ text: string;
90
+ language: string;
91
+ startTime: number;
92
+ endTime: number;
93
+ final: boolean;
94
+ firstReceivedTime: number;
95
+ lastReceivedTime: number;
96
+ }
97
+ export interface ChatMessage {
98
+ id: string;
99
+ timestamp: number;
100
+ message: string;
101
+ editTimestamp?: number;
102
+ attachedFiles?: Array<File>;
103
+ }
104
+ export interface StreamController<T extends DataStream_Chunk> {
105
+ info: BaseStreamInfo;
106
+ controller: ReadableStreamDefaultController<T>;
107
+ startTime: number;
108
+ endTime?: number;
109
+ sendingParticipantIdentity: string;
110
+ }
111
+ export interface BaseStreamInfo {
112
+ id: string;
113
+ mimeType: string;
114
+ topic: string;
115
+ timestamp: number;
116
+ /** total size in bytes for finite streams and undefined for streams of unknown size */
117
+ size?: number;
118
+ attributes?: Record<string, string>;
119
+ encryptionType: Encryption_Type;
120
+ }
121
+ export interface ByteStreamInfo extends BaseStreamInfo {
122
+ name: string;
123
+ }
124
+ export interface TextStreamInfo extends BaseStreamInfo {
125
+ attachedStreamIds?: Array<string>;
126
+ }
127
+ //# sourceMappingURL=types.d.ts.map