feat: add screen share audio support

Pass audio: true to setScreenShareEnabled so the browser offers the
"Share audio" checkbox. Track ScreenShareAudio from remote participants
and play it through a dedicated audio element with the same volume
pipeline (including boost >100%).
This commit is contained in:
Jannis Braun
2026-02-20 03:16:34 +01:00
parent a8be2dd5da
commit a8656e6a3b
5 changed files with 116 additions and 20 deletions
@@ -42,7 +42,11 @@ export function VoiceControls() {
const room = getActiveRoom();
if (!room) return;
try {
await room.localParticipant.setScreenShareEnabled(!isScreenSharing);
if (!isScreenSharing) {
await room.localParticipant.setScreenShareEnabled(true, { audio: true });
} else {
await room.localParticipant.setScreenShareEnabled(false);
}
toggleScreenShare();
} catch (err) {
console.error('[VoiceControls] Failed to toggle screen share:', err);