perf(app): defer media capture routing and skip offscreen skeleton layout (#1732)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-19 02:58:01 +02:00
1 parent 591e9fe2ba
commit 698469fa96
9 files changed
+168 -34

No files matched your search

@@ -236,10 +236,33 @@ export function getSoundCaptureMasterGainNode(): GainNode {
return getMasterGainNode();
}
const soundCaptureActivationListeners: Set<() => void> = new Set();
export function isSoundCaptureActive(): boolean {
return captureTaps.size > 0;
}
export function onSoundCaptureActivated(listener: () => void): () => void {
soundCaptureActivationListeners.add(listener);
return () => {
soundCaptureActivationListeners.delete(listener);
};
}
export function addSoundCaptureDestination(node: AudioNode): void {
if (captureTaps.has(node)) return;
const master = getMasterGainNode();
const wasInactive = captureTaps.size === 0;
captureTaps.add(node);
if (wasInactive) {
for (const listener of soundCaptureActivationListeners) {
try {
listener();
} catch (error) {
logger.warn('Sound capture activation listener failed', error);
}
}
}
try {
master.connect(node);
} catch (error) {