@voltkit-rtc/client 0.7.3 → 0.8.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +244 -2
  3. package/dist/cjs/adaptive.d.ts +104 -0
  4. package/dist/cjs/adaptive.d.ts.map +1 -0
  5. package/dist/cjs/adaptive.js +263 -0
  6. package/dist/cjs/adaptive.js.map +1 -0
  7. package/dist/cjs/devices.d.ts +42 -0
  8. package/dist/cjs/devices.d.ts.map +1 -0
  9. package/dist/cjs/devices.js +56 -0
  10. package/dist/cjs/devices.js.map +1 -0
  11. package/dist/cjs/diagnostics.d.ts +65 -0
  12. package/dist/cjs/diagnostics.d.ts.map +1 -0
  13. package/dist/cjs/diagnostics.js +69 -0
  14. package/dist/cjs/diagnostics.js.map +1 -0
  15. package/dist/cjs/fallback.d.ts +81 -0
  16. package/dist/cjs/fallback.d.ts.map +1 -0
  17. package/dist/cjs/fallback.js +148 -0
  18. package/dist/cjs/fallback.js.map +1 -0
  19. package/dist/cjs/health.d.ts +70 -0
  20. package/dist/cjs/health.d.ts.map +1 -0
  21. package/dist/cjs/health.js +116 -0
  22. package/dist/cjs/health.js.map +1 -0
  23. package/dist/cjs/index.d.ts +339 -0
  24. package/dist/cjs/index.d.ts.map +1 -1
  25. package/dist/cjs/index.js +1098 -26
  26. package/dist/cjs/index.js.map +1 -1
  27. package/dist/cjs/link.d.ts +99 -0
  28. package/dist/cjs/link.d.ts.map +1 -0
  29. package/dist/cjs/link.js +219 -0
  30. package/dist/cjs/link.js.map +1 -0
  31. package/dist/cjs/preflight.d.ts +79 -0
  32. package/dist/cjs/preflight.d.ts.map +1 -0
  33. package/dist/cjs/preflight.js +159 -0
  34. package/dist/cjs/preflight.js.map +1 -0
  35. package/dist/cjs/speakers.d.ts +34 -0
  36. package/dist/cjs/speakers.d.ts.map +1 -0
  37. package/dist/cjs/speakers.js +71 -0
  38. package/dist/cjs/speakers.js.map +1 -0
  39. package/dist/esm/adaptive.d.ts +104 -0
  40. package/dist/esm/adaptive.d.ts.map +1 -0
  41. package/dist/esm/adaptive.js +256 -0
  42. package/dist/esm/adaptive.js.map +1 -0
  43. package/dist/esm/devices.d.ts +42 -0
  44. package/dist/esm/devices.d.ts.map +1 -0
  45. package/dist/esm/devices.js +50 -0
  46. package/dist/esm/devices.js.map +1 -0
  47. package/dist/esm/diagnostics.d.ts +65 -0
  48. package/dist/esm/diagnostics.d.ts.map +1 -0
  49. package/dist/esm/diagnostics.js +65 -0
  50. package/dist/esm/diagnostics.js.map +1 -0
  51. package/dist/esm/fallback.d.ts +81 -0
  52. package/dist/esm/fallback.d.ts.map +1 -0
  53. package/dist/esm/fallback.js +142 -0
  54. package/dist/esm/fallback.js.map +1 -0
  55. package/dist/esm/health.d.ts +70 -0
  56. package/dist/esm/health.d.ts.map +1 -0
  57. package/dist/esm/health.js +111 -0
  58. package/dist/esm/health.js.map +1 -0
  59. package/dist/esm/index.d.ts +339 -0
  60. package/dist/esm/index.d.ts.map +1 -1
  61. package/dist/esm/index.js +1096 -26
  62. package/dist/esm/index.js.map +1 -1
  63. package/dist/esm/link.d.ts +99 -0
  64. package/dist/esm/link.d.ts.map +1 -0
  65. package/dist/esm/link.js +214 -0
  66. package/dist/esm/link.js.map +1 -0
  67. package/dist/esm/preflight.d.ts +79 -0
  68. package/dist/esm/preflight.d.ts.map +1 -0
  69. package/dist/esm/preflight.js +153 -0
  70. package/dist/esm/preflight.js.map +1 -0
  71. package/dist/esm/speakers.d.ts +34 -0
  72. package/dist/esm/speakers.d.ts.map +1 -0
  73. package/dist/esm/speakers.js +67 -0
  74. package/dist/esm/speakers.js.map +1 -0
  75. package/package.json +1 -1
  76. package/src/adaptive.ts +295 -0
  77. package/src/devices.ts +70 -0
  78. package/src/diagnostics.ts +94 -0
  79. package/src/fallback.ts +169 -0
  80. package/src/health.ts +127 -0
  81. package/src/index.ts +1097 -27
  82. package/src/link.ts +255 -0
  83. package/src/preflight.ts +191 -0
  84. package/src/speakers.ts +66 -0
@@ -0,0 +1,214 @@
1
+ /**
2
+ * Keeping the connection alive between drops (docs/implementation-progress/RTC_PERF_PROGRESS.md G1, G2).
3
+ *
4
+ * Two failures the socket's own close never reports:
5
+ *
6
+ * - **The media path dies while the socket lives** (Wi-Fi to mobile data, a NAT rebinding, UDP blocked mid-call).
7
+ * The video freezes for good. Twilio and LiveKit restart ICE on the same transports first -- new ICE credentials
8
+ * from the server, the same producers and consumers -- and rejoin only when that does not bring the path back.
9
+ * {@link MediaPathWatch} does the same: a transport `disconnected` for {@link DISCONNECTED_GRACE_MS} or `failed`
10
+ * restarts ICE; not `connected` within {@link RESTART_TIMEOUT_MS} of starting recovery (including the request), or a server without `restartIce`, is a
11
+ * full reconnect.
12
+ * - **The socket dies silently**: the network went away and TCP has not noticed yet, which can take minutes. The
13
+ * server pings, but a browser cannot see those. LiveKit pings from the client and reconnects when no pong comes.
14
+ * {@link SocketLiveness} sends `ping` after {@link IDLE_MS} with nothing received, and calls the socket dead when
15
+ * nothing at all arrives within {@link PING_TIMEOUT_MS} of it. Any frame counts, so an older server's
16
+ * `unknown-method` reply proves the socket as well as a pong.
17
+ *
18
+ * Pure: timers and the clock are injectable, so the decisions are unit-tested on their own.
19
+ */
20
+ /** A transport `disconnected` this long is restarted (it often recovers by itself within a second or two). */
21
+ export const DISCONNECTED_GRACE_MS = 3000;
22
+ /** The whole ICE recovery, including the request, has this long before the session rejoins. */
23
+ export const RESTART_TIMEOUT_MS = 10_000;
24
+ /** With nothing received for this long, the client pings. */
25
+ export const IDLE_MS = 15_000;
26
+ /** A ping with nothing at all received for this long after it: the socket is dead. */
27
+ export const PING_TIMEOUT_MS = 8000;
28
+ /** How often liveness is checked. Background tabs may run it less often; the decisions use the clock, not counts. */
29
+ export const LIVENESS_TICK_MS = 5000;
30
+ /** Watches each media transport's connection state and recovers a dead path. */
31
+ export class MediaPathWatch {
32
+ host;
33
+ entries = new Map();
34
+ setTimer;
35
+ clearTimer;
36
+ constructor(host) {
37
+ this.host = host;
38
+ this.setTimer = host.setTimer ?? ((fn, ms) => setTimeout(fn, ms));
39
+ this.clearTimer = host.clearTimer ?? ((h) => clearTimeout(h));
40
+ }
41
+ /** A transport's connection state changed (mediasoup-client `connectionstatechange`). */
42
+ update(transportId, state) {
43
+ let entry = this.entries.get(transportId);
44
+ if (!entry) {
45
+ entry = { state, timer: null, restarting: false, lost: false, revision: 0 };
46
+ this.entries.set(transportId, entry);
47
+ }
48
+ entry.state = state;
49
+ switch (state) {
50
+ case 'connected':
51
+ entry.revision++;
52
+ this.cancel(entry);
53
+ entry.restarting = false;
54
+ this.setLost(transportId, entry, false);
55
+ return;
56
+ case 'closed':
57
+ this.forget(transportId);
58
+ return;
59
+ case 'disconnected':
60
+ // A restart is already waiting for `connected`; its own deadline decides.
61
+ if (entry.restarting || entry.timer !== null)
62
+ return;
63
+ entry.timer = this.setTimer(() => {
64
+ entry.timer = null;
65
+ if (entry.state === 'disconnected' || entry.state === 'failed')
66
+ void this.restart(transportId, entry);
67
+ }, DISCONNECTED_GRACE_MS);
68
+ return;
69
+ case 'failed':
70
+ if (entry.restarting)
71
+ return; // duplicate notification; the deadline decides
72
+ this.cancel(entry);
73
+ void this.restart(transportId, entry);
74
+ return;
75
+ default:
76
+ // new / connecting: a fresh transport, or one mid-restart.
77
+ return;
78
+ }
79
+ }
80
+ /** The transport went away with its session (teardown): no more decisions for it. */
81
+ forget(transportId) {
82
+ const entry = this.entries.get(transportId);
83
+ if (!entry)
84
+ return;
85
+ this.cancel(entry);
86
+ this.entries.delete(transportId);
87
+ if (entry.lost)
88
+ this.host.onPathChange?.(transportId, false);
89
+ }
90
+ /** Every transport went away (teardown, close). */
91
+ reset() {
92
+ for (const id of [...this.entries.keys()])
93
+ this.forget(id);
94
+ }
95
+ /** For tests and the network-change nudge: is this transport being recovered now? */
96
+ restartingNow(transportId) {
97
+ return this.entries.get(transportId)?.restarting === true;
98
+ }
99
+ async restart(transportId, entry) {
100
+ if (!this.host.active() || this.entries.get(transportId) !== entry)
101
+ return;
102
+ entry.restarting = true;
103
+ const revision = ++entry.revision;
104
+ // Include both the RPC and the platform call in the deadline: neither is
105
+ // guaranteed to settle when a network/interface disappears.
106
+ this.cancel(entry);
107
+ entry.timer = this.setTimer(() => {
108
+ entry.timer = null;
109
+ if (!entry.restarting || this.entries.get(transportId) !== entry)
110
+ return;
111
+ entry.revision++;
112
+ entry.restarting = false;
113
+ if (this.host.active())
114
+ this.host.reconnect('media-timeout');
115
+ }, RESTART_TIMEOUT_MS);
116
+ this.setLost(transportId, entry, true);
117
+ let outcome;
118
+ try {
119
+ outcome = await this.host.restartIce(transportId);
120
+ }
121
+ catch {
122
+ outcome = 'unsupported';
123
+ }
124
+ if (this.entries.get(transportId) !== entry || entry.revision !== revision)
125
+ return;
126
+ if (outcome === 'skipped') {
127
+ this.cancel(entry);
128
+ entry.restarting = false;
129
+ return;
130
+ }
131
+ if (outcome === 'unsupported') {
132
+ this.cancel(entry);
133
+ entry.restarting = false;
134
+ if (this.host.active())
135
+ this.host.reconnect('media-failed');
136
+ return;
137
+ }
138
+ // `connected` clears the deadline, including when it arrives during the await.
139
+ }
140
+ setLost(transportId, entry, lost) {
141
+ if (entry.lost === lost)
142
+ return;
143
+ entry.lost = lost;
144
+ this.host.onPathChange?.(transportId, lost);
145
+ }
146
+ cancel(entry) {
147
+ if (entry.timer !== null)
148
+ this.clearTimer(entry.timer);
149
+ entry.timer = null;
150
+ }
151
+ }
152
+ /** Notices a socket that died without closing. */
153
+ export class SocketLiveness {
154
+ host;
155
+ lastReceived = 0;
156
+ pingSentAt = null;
157
+ timer = null;
158
+ now;
159
+ constructor(host) {
160
+ this.host = host;
161
+ this.now = host.now ?? Date.now;
162
+ }
163
+ /** Start watching a newly opened socket. */
164
+ start() {
165
+ this.stop();
166
+ this.lastReceived = this.now();
167
+ this.pingSentAt = null;
168
+ const every = this.host.setInterval ?? ((fn, ms) => setInterval(fn, ms));
169
+ this.timer = every(() => this.check(), LIVENESS_TICK_MS);
170
+ // A Node/SSR process with no other work need not stay alive for a browser
171
+ // connection watch. Browser timers are numbers and have no unref.
172
+ this.timer?.unref?.();
173
+ }
174
+ stop() {
175
+ if (this.timer !== null)
176
+ (this.host.clearInterval ?? ((h) => clearInterval(h)))(this.timer);
177
+ this.timer = null;
178
+ this.pingSentAt = null;
179
+ }
180
+ get running() {
181
+ return this.timer !== null;
182
+ }
183
+ /** Any frame arrived on the socket. */
184
+ received() {
185
+ this.lastReceived = this.now();
186
+ this.pingSentAt = null;
187
+ }
188
+ /** Check now instead of at the next tick (the browser said the network changed). */
189
+ checkNow() {
190
+ if (this.timer === null || !this.host.active())
191
+ return;
192
+ if (this.pingSentAt === null) {
193
+ this.pingSentAt = this.now();
194
+ this.host.ping();
195
+ }
196
+ }
197
+ check() {
198
+ if (this.timer === null || !this.host.active())
199
+ return;
200
+ const now = this.now();
201
+ if (this.pingSentAt !== null) {
202
+ if (now - this.pingSentAt >= PING_TIMEOUT_MS) {
203
+ this.stop();
204
+ this.host.dead();
205
+ }
206
+ return;
207
+ }
208
+ if (now - this.lastReceived >= IDLE_MS) {
209
+ this.pingSentAt = now;
210
+ this.host.ping();
211
+ }
212
+ }
213
+ }
214
+ //# sourceMappingURL=link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/link.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8GAA8G;AAC9G,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC;AAC9B,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AACpC,qHAAqH;AACrH,MAAM,CAAC,MAAM,gBAAgB,G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AI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAAE,OAAO;QACvD,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAAE,OAAO;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YAC7B,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,IAAI,eAAe,EAAE,CAAC;gBAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;gBACZ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACnB,CAAC;YACD,OAAO;QACT,CAAC;QACD,IAAI,GAAG,GAAG,IAAI,CAAC,YAAY,IAAI,OAAO,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Pre-call check (docs/implementation-progress/RTC_PERF_PROGRESS.md L1).
3
+ *
4
+ * - Twilio's `runPreflight` (read from its code) joins a test room, publishes synthetic audio and video and reports
5
+ * timings, the connection path, round trip, jitter and loss.
6
+ * - LiveKit's `ConnectionCheck` runs separate checks -- WebSocket, WebRTC, TURN, publishing audio and video, UDP
7
+ * against TCP -- each with messages and warnings.
8
+ * - Agora's `startLastmileProbeTest` measures the last mile before a call.
9
+ *
10
+ * This joins the room the token names (mint one for a test room nobody else is in: the session is real, and billed
11
+ * like any other for its few seconds), publishes what it is given -- or a tone and a picture it makes -- and reports
12
+ * what it saw. The orchestration takes a small target interface, so it is tested without a browser.
13
+ */
14
+ import { type NetworkQualityLevel } from './network.js';
15
+ import type { StatsEntry } from './stats.js';
16
+ import type { MediaWarningCode } from './health.js';
17
+ export interface PreflightOptions {
18
+ /** What to publish (cloned; your tracks are left running). Without it, a tone and a moving picture are made. */
19
+ media?: MediaStream;
20
+ /** How long media is measured once it flows. Default 5 s. */
21
+ durationMs?: number;
22
+ }
23
+ export type PreflightStepName = 'join' | 'media';
24
+ export interface PreflightStep {
25
+ name: PreflightStepName;
26
+ ok: boolean;
27
+ /** How long it took, in ms. */
28
+ ms: number | null;
29
+ error?: string;
30
+ }
31
+ export interface PreflightReport {
32
+ /** Joined, and media reached the server. */
33
+ ok: boolean;
34
+ steps: PreflightStep[];
35
+ /** How media travelled: UDP is best; TCP or a relay means a firewall in the way (it works, with more delay). */
36
+ path: {
37
+ protocol: 'udp' | 'tcp' | null;
38
+ relayed: boolean;
39
+ } | null;
40
+ rttMs: number | null;
41
+ lossPct: number | null;
42
+ /** The upload the browser estimated it could use, in kbps. */
43
+ uploadKbps: number | null;
44
+ level: NetworkQualityLevel | null;
45
+ /** Camera and microphone problems seen during the test (see the mediaWarning event). */
46
+ warnings: MediaWarningCode[];
47
+ }
48
+ /** What a pre-call check needs from a client. */
49
+ export interface PreflightTarget {
50
+ connect(): Promise<unknown>;
51
+ publish(stream: MediaStream): Promise<void>;
52
+ /** The send transport's connection state, or null before there is one. */
53
+ sendState(): string | null;
54
+ /** The send transport's statistics, or null without one. */
55
+ sendStats(): Promise<Iterable<StatsEntry> | null>;
56
+ onWarning(listener: (code: MediaWarningCode, active: boolean) => void): () => void;
57
+ close(): void;
58
+ }
59
+ export interface PreflightEnv {
60
+ now(): number;
61
+ sleep(ms: number): Promise<void>;
62
+ }
63
+ /** Media has this long to connect once published. */
64
+ export declare const MEDIA_CONNECT_TIMEOUT_MS = 10000;
65
+ /** Statistics are read this often while measuring. */
66
+ export declare const PREFLIGHT_SAMPLE_MS = 1000;
67
+ /** The selected candidate pair's protocol, and whether either end is a relay. */
68
+ export declare function connectionPath(report: Iterable<StatsEntry>): PreflightReport['path'];
69
+ /** Run the check on `target`, closing it at the end whatever happens. */
70
+ export declare function runPreflight(target: PreflightTarget, stream: MediaStream, options?: PreflightOptions, env?: PreflightEnv): Promise<PreflightReport>;
71
+ /**
72
+ * A tone and a moving picture to publish when the app gives none (Twilio's preflight makes synthetic media too).
73
+ * Returns the stream and a function that stops everything it made. Browser only.
74
+ */
75
+ export declare function syntheticMedia(): {
76
+ stream: MediaStream;
77
+ stop: () => void;
78
+ };
79
+ //# sourceMappingURL=preflight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.d.ts","sourceRoot":"","sources":["../../src/preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAwC,KAAK,mBAAmB,EAAwB,MAAM,cAAc,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,gHAAgH;IAChH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,+BAA+B;IAC/B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,gHAAgH;IAChH,IAAI,EAAE;QAAE,QAAQ,E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AM,EAAE,WAAW,EAAE,OAAO,GAAE,gBAAqB,EAAE,GAAG,GAAE,YAAsB,GAAG,OAAO,CAAC,eAAe,CAAC,CAsDtK;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAqC1E"}
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Pre-call check (docs/implementation-progress/RTC_PERF_PROGRESS.md L1).
3
+ *
4
+ * - Twilio's `runPreflight` (read from its code) joins a test room, publishes synthetic audio and video and reports
5
+ * timings, the connection path, round trip, jitter and loss.
6
+ * - LiveKit's `ConnectionCheck` runs separate checks -- WebSocket, WebRTC, TURN, publishing audio and video, UDP
7
+ * against TCP -- each with messages and warnings.
8
+ * - Agora's `startLastmileProbeTest` measures the last mile before a call.
9
+ *
10
+ * This joins the room the token names (mint one for a test room nobody else is in: the session is real, and billed
11
+ * like any other for its few seconds), publishes what it is given -- or a tone and a picture it makes -- and reports
12
+ * what it saw. The orchestration takes a small target interface, so it is tested without a browser.
13
+ */
14
+ import { networkQualityOf, readTransportStats } from './network.js';
15
+ const realEnv = { now: () => Date.now(), sleep: (ms) => new Promise((r) => setTimeout(r, ms)) };
16
+ /** Media has this long to connect once published. */
17
+ export const MEDIA_CONNECT_TIMEOUT_MS = 10_000;
18
+ /** Statistics are read this often while measuring. */
19
+ export const PREFLIGHT_SAMPLE_MS = 1000;
20
+ /** The selected candidate pair's protocol, and whether either end is a relay. */
21
+ export function connectionPath(report) {
22
+ const entries = [...report];
23
+ const byId = new Map();
24
+ for (const e of entries)
25
+ if (typeof e.id === 'string')
26
+ byId.set(e.id, e);
27
+ let pair;
28
+ for (const t of entries.filter((e) => e.type === 'transport')) {
29
+ if (typeof t.selectedCandidatePairId === 'string')
30
+ pair = byId.get(t.selectedCandidatePairId);
31
+ if (pair)
32
+ break;
33
+ }
34
+ pair ??= entries.find((e) => e.type === 'candidate-pair' && e.nominated === true && e.state === 'succeeded');
35
+ if (!pair)
36
+ return null;
37
+ const local = typeof pair.localCandidateId === 'string' ? byId.get(pair.localCandidateId) : undefined;
38
+ const remote = typeof pair.remoteCandidateId === 'string' ? byId.get(pair.remoteCandidateId) : undefined;
39
+ const protocol = local?.protocol === 'udp' || local?.protocol === 'tcp' ? local.protocol : null;
40
+ const relayed = local?.candidateType === 'relay' || remote?.candidateType === 'relay';
41
+ return { protocol, relayed };
42
+ }
43
+ /** Run the check on `target`, closing it at the end whatever happens. */
44
+ export async function runPreflight(target, stream, options = {}, env = realEnv) {
45
+ const report = { ok: false, steps: [], path: null, rttMs: null, lossPct: null, uploadKbps: null, level: null, warnings: [] };
46
+ const seen = new Set();
47
+ const stopWarnings = target.onWarning((code, active) => { if (active)
48
+ seen.add(code); });
49
+ try {
50
+ let started = env.now();
51
+ try {
52
+ await target.connect();
53
+ report.steps.push({ name: 'join', ok: true, ms: env.now() - started });
54
+ }
55
+ catch (err) {
56
+ report.steps.push({ name: 'join', ok: false, ms: null, error: String(err?.message ?? err) });
57
+ return report;
58
+ }
59
+ started = env.now();
60
+ try {
61
+ await target.publish(stream);
62
+ while (target.sendState() !== 'connected') {
63
+ const state = target.sendState();
64
+ if (state === 'failed' || state === 'closed')
65
+ throw new Error(`media connection ${state}`);
66
+ if (env.now() - started > MEDIA_CONNECT_TIMEOUT_MS)
67
+ throw new Error('media did not connect in time (a firewall blocking UDP and TCP?)');
68
+ await env.sleep(100);
69
+ }
70
+ report.steps.push({ name: 'media', ok: true, ms: env.now() - started });
71
+ }
72
+ catch (err) {
73
+ report.steps.push({ name: 'media', ok: false, ms: null, error: String(err?.message ?? err) });
74
+ return report;
75
+ }
76
+ // Measure: the worst round trip and loss over the run, the last upload estimate.
77
+ const duration = options.durationMs ?? 5000;
78
+ let previous = new Map();
79
+ const until = env.now() + duration;
80
+ while (env.now() < until) {
81
+ await env.sleep(PREFLIGHT_SAMPLE_MS);
82
+ const stats = await target.sendStats().catch(() => null);
83
+ if (!stats)
84
+ continue;
85
+ const entries = [...stats];
86
+ report.path = connectionPath(entries) ?? report.path;
87
+ const now = new Map([['send', readTransportStats(entries)]]);
88
+ const q = networkQualityOf(now, previous, true);
89
+ previous = now;
90
+ if (q.rttMs !== null)
91
+ report.rttMs = Math.max(report.rttMs ?? 0, q.rttMs);
92
+ if (q.lossPct !== null)
93
+ report.lossPct = Math.max(report.lossPct ?? 0, q.lossPct);
94
+ if (q.availableKbps !== null)
95
+ report.uploadKbps = q.availableKbps;
96
+ report.level = q.level;
97
+ }
98
+ report.ok = true;
99
+ return report;
100
+ }
101
+ finally {
102
+ report.warnings = [...seen];
103
+ stopWarnings();
104
+ target.close();
105
+ }
106
+ }
107
+ /**
108
+ * A tone and a moving picture to publish when the app gives none (Twilio's preflight makes synthetic media too).
109
+ * Returns the stream and a function that stops everything it made. Browser only.
110
+ */
111
+ export function syntheticMedia() {
112
+ const tracks = [];
113
+ const stops = [];
114
+ const AudioCtx = globalThis.AudioContext;
115
+ if (AudioCtx) {
116
+ const ctx = new AudioCtx();
117
+ const osc = ctx.createOscillator();
118
+ const gain = ctx.createGain();
119
+ gain.gain.value = 0.05;
120
+ const dest = ctx.createMediaStreamDestination();
121
+ osc.connect(gain).connect(dest);
122
+ osc.start();
123
+ tracks.push(...dest.stream.getAudioTracks());
124
+ stops.push(() => { osc.stop(); void ctx.close(); });
125
+ }
126
+ if (typeof document !== 'undefined') {
127
+ const canvas = document.createElement('canvas');
128
+ canvas.width = 640;
129
+ canvas.height = 360;
130
+ const g = canvas.getContext('2d');
131
+ let frame = 0;
132
+ const draw = () => {
133
+ if (!g)
134
+ return;
135
+ frame += 1;
136
+ g.fillStyle = `hsl(${frame % 360}, 60%, 40%)`;
137
+ g.fillRect(0, 0, canvas.width, canvas.height);
138
+ g.fillStyle = '#fff';
139
+ g.fillRect((frame * 8) % canvas.width, 150, 60, 60);
140
+ };
141
+ draw();
142
+ const timer = setInterval(draw, 1000 / 30);
143
+ const captured = canvas.captureStream?.(30);
144
+ if (captured)
145
+ tracks.push(...captured.getVideoTracks());
146
+ stops.push(() => clearInterval(timer));
147
+ }
148
+ const stream = new MediaStream(tracks);
149
+ return { stream, stop: () => { for (const t of tracks)
150
+ t.stop(); for (const s of stops)
151
+ s(); } };
152
+ }
153
+ //# sourceMappingURL=preflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../src/preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAkD,MAAM,cAAc,CAAC;AAqDpH,MAAM,OAAO,GAAiB,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;AAE9G,qDAAqD;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAC/C,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,MAA4B;IACzD,MAAM,OAAO,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,OAAO;QAAE,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ;YAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACzE,IAAI,IAA4B,CAAC;IACjC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,EAAE,CAAC;QAC9D,IAAI,OA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C,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC;QACF,IAAI,EAAE,CAAC;QACP,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAI,MAA+E,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QACtH,IAAI,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC,IAAI,MAAM;YAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,IAAI,KAAK;YAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACnG,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Audio levels and active speakers (docs/implementation-progress/RTC_PERF_PROGRESS.md J1).
3
+ *
4
+ * - Agora `volume-indicator` and Tencent TRTC `AUDIO_VOLUME` report every participant's volume on an interval.
5
+ * - Amazon Chime's `DefaultActiveSpeakerPolicy` (read from its code) ranks speakers: a volume above a silence
6
+ * threshold counts as speaking (1, else 0); each sample the speaker's score becomes `score × 0.9 + speaking × 0.1`,
7
+ * and everyone else's drops by `0.2 × speaking` (the takeover); scores under 0.01 are 0. Its detector updates every
8
+ * 200 ms. Sampled together here, so two people speaking at once both stay; the takeover applies to the silent.
9
+ * - LiveKit's server counts a participant as speaking above -35 dBov.
10
+ *
11
+ * Levels are WebRTC's `audioLevel`: linear, 0 = silence, 1 = 0 dBov. -35 dBov is 10^(-35/20) ≈ 0.0178.
12
+ * Pure: the ranking takes levels and gives the order.
13
+ */
14
+ /** Above this level a participant is speaking (LiveKit's -35 dBov). */
15
+ export declare const SPEAKING_LEVEL = 0.0178;
16
+ /** How often levels are read while someone listens (Chime's detector: 200 ms). */
17
+ export declare const AUDIO_LEVEL_INTERVAL_MS = 250;
18
+ export declare const SPEAKER_WEIGHT = 0.9;
19
+ export declare const TAKEOVER_RATE = 0.2;
20
+ export declare const SCORE_CUTOFF = 0.01;
21
+ /** Chime's active speaker ranking: who has been speaking recently, the most recent and steady first. */
22
+ export declare class ActiveSpeakers {
23
+ private readonly scores;
24
+ private last;
25
+ /**
26
+ * One sample: each identity's loudest level now (0..1). Identities missing from it count as silent. Returns the new
27
+ * order when it changed, else null.
28
+ */
29
+ update(levels: ReadonlyMap<string, number>): string[] | null;
30
+ /** Someone left: forget them. Returns the new order when it changed. */
31
+ remove(identity: string): string[] | null;
32
+ reset(): void;
33
+ }
34
+ //# sourceMappingURL=speakers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speakers.d.ts","sourceRoot":"","sources":["../../src/speakers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,kFAAkF;AAClF,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC,wGAAwG;AACxG,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,IAAI,CAAgB;IAE5B;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,IAAI;IAoB5D,wEAAwE;IACxE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI;IAQzC,KAAK,IAAI,IAAI;CAId"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Audio levels and active speakers (docs/implementation-progress/RTC_PERF_PROGRESS.md J1).
3
+ *
4
+ * - Agora `volume-indicator` and Tencent TRTC `AUDIO_VOLUME` report every participant's volume on an interval.
5
+ * - Amazon Chime's `DefaultActiveSpeakerPolicy` (read from its code) ranks speakers: a volume above a silence
6
+ * threshold counts as speaking (1, else 0); each sample the speaker's score becomes `score × 0.9 + speaking × 0.1`,
7
+ * and everyone else's drops by `0.2 × speaking` (the takeover); scores under 0.01 are 0. Its detector updates every
8
+ * 200 ms. Sampled together here, so two people speaking at once both stay; the takeover applies to the silent.
9
+ * - LiveKit's server counts a participant as speaking above -35 dBov.
10
+ *
11
+ * Levels are WebRTC's `audioLevel`: linear, 0 = silence, 1 = 0 dBov. -35 dBov is 10^(-35/20) ≈ 0.0178.
12
+ * Pure: the ranking takes levels and gives the order.
13
+ */
14
+ /** Above this level a participant is speaking (LiveKit's -35 dBov). */
15
+ export const SPEAKING_LEVEL = 0.0178;
16
+ /** How often levels are read while someone listens (Chime's detector: 200 ms). */
17
+ export const AUDIO_LEVEL_INTERVAL_MS = 250;
18
+ export const SPEAKER_WEIGHT = 0.9;
19
+ export const TAKEOVER_RATE = 0.2;
20
+ export const SCORE_CUTOFF = 0.01;
21
+ /** Chime's active speaker ranking: who has been speaking recently, the most recent and steady first. */
22
+ export class ActiveSpeakers {
23
+ scores = new Map();
24
+ last = [];
25
+ /**
26
+ * One sample: each identity's loudest level now (0..1). Identities missing from it count as silent. Returns the new
27
+ * order when it changed, else null.
28
+ */
29
+ update(levels) {
30
+ for (const id of levels.keys())
31
+ if (!this.scores.has(id))
32
+ this.scores.set(id, 0);
33
+ // Chime updates one attendee at a time as volumes arrive; here everyone is sampled together, so people speaking
34
+ // at the same moment do not take over from each other -- only the silent ones lose ground.
35
+ const speakingNow = new Set([...levels].filter(([, level]) => level > SPEAKING_LEVEL).map(([id]) => id));
36
+ for (const id of this.scores.keys()) {
37
+ const speaking = speakingNow.has(id) ? 1 : 0;
38
+ let score = (this.scores.get(id) ?? 0) * SPEAKER_WEIGHT + speaking * (1 - SPEAKER_WEIGHT);
39
+ if (!speaking && speakingNow.size > 0)
40
+ score = Math.max(score - TAKEOVER_RATE, 0);
41
+ this.scores.set(id, score);
42
+ }
43
+ const order = [...this.scores.entries()]
44
+ .filter(([, score]) => score >= SCORE_CUTOFF)
45
+ .sort((a, b) => b[1] - a[1] || (a[0] < b[0] ? -1 : 1))
46
+ .map(([id]) => id);
47
+ if (order.length === this.last.length && order.every((id, i) => id === this.last[i]))
48
+ return null;
49
+ this.last = order;
50
+ return order;
51
+ }
52
+ /** Someone left: forget them. Returns the new order when it changed. */
53
+ remove(identity) {
54
+ if (!this.scores.delete(identity))
55
+ return null;
56
+ const order = this.last.filter((id) => id !== identity);
57
+ if (order.length === this.last.length)
58
+ return null;
59
+ this.last = order;
60
+ return order;
61
+ }
62
+ reset() {
63
+ this.scores.clear();
64
+ this.last = [];
65
+ }
66
+ }
67
+ //# sourceMappingURL=speakers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speakers.js","sourceRoot":"","sources":["../../src/speakers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC;AACrC,kFAAkF;AAClF,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC,wGAAwG;AACxG,MAAM,OAAO,cAAc;IACR,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5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 -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltkit-rtc/client",
3
- "version": "0.7.3",
3
+ "version": "0.8.0",
4
4
  "description": "Browser SDK for VoltKit RTC: realtime audio/video rooms, chat and live broadcast publishing.",
5
5
  "keywords": [
6
6
  "voltkit",