fix: disable browser DSP on screen share audio and harden ICE stats resolution

Screen share audio was muffled/gated because getDisplayMedia used plain
`audio: true`, letting the browser apply voice-optimized DSP (NS, AEC, AGC)
to desktop audio. Now passes explicit constraints disabling all processing
and requesting stereo capture.

Also improves WebRTC stats: three-tier ICE candidate-pair discovery
(transport → active-bytes heuristic → legacy fallback), height-based
simulcast layer inference, and documents mDNS obfuscation limitation.
This commit is contained in:
Jannis Braun
2026-02-24 02:31:24 +01:00
parent f808a204e7
commit 2342396fce
2 changed files with 72 additions and 39 deletions
+6 -1
View File
@@ -121,7 +121,12 @@ export async function startScreenShare(room: Room): Promise<boolean> {
try {
const track = await room.localParticipant.setScreenShareEnabled(true, {
audio: true,
audio: {
echoCancellation: false,
noiseSuppression: false,
autoGainControl: false,
channelCount: 2,
},
resolution: { width: opts.capture.width, height: opts.capture.height },
// @ts-ignore — LiveKit accepts frameRate at capture level
frameRate: opts.capture.frameRate,