Skip to content

Share tab audio when screen sharing in meetings - #180

Merged
Anuraj-dev merged 1 commit into
mainfrom
feat/meeting-screen-share-audio
Oct 22, 2026
Merged

Anuraj-dev merged 1 commit into
mainfrom
feat/meeting-screen-share-audio

Conversation

@Anuraj-dev

Copy link
Copy Markdown
Owner

Problem

Meeting screen share sent video only, so a shared tab's sound never reached the room. Also, a peer's meeting audio elements were keyed by identity. A presenter's mic and screen-share audio would overwrite each other, so turning the mic off could cut the shared audio.

Behavior

The share picker now offers Also share tab audio (and system audio for a whole screen in Chrome). When ticked, everyone in the meeting hears it. The presenter still hears the tab locally. Local mute/block silences a peer's shared audio as well as their mic.

Implementation

  • RoomVideo.setScreenShareEnabled(true) passes capture options to LiveKit (audio with voice processing off, systemAudio: 'include', suppressLocalAudioPlayback: false) and publish options (128 kbps, dtx: false, forceStereo: true). LiveKit publishes the audio as ScreenShareAudio and unpublishes it with the video.
  • TrackSinks attach/detach now receive the trackSid. The meeting room keys audio elements per track; moderation and participant-disconnect cleanup look up the owner via dataset.identity. World and stage rooms are unchanged.
  • Frontend only; no backend or token-grant change needed (meeting tokens do not restrict track sources).

Verification

  • focused npx vitest run src/media/livekit.room.test.ts src/media/livekit.stage.test.ts src/media/livekit.world.test.ts: 27/27 passed, including new tests for capture/publish options, independent mic vs shared-audio detach, and moderation of both
  • tsc --noEmit on app and test configs: exit 0; eslint on touched files: exit 0
  • Not verified in a real browser: the native display picker cannot be automated.

Meeting screen share now asks the picker for tab/system audio and publishes it as stereo music with DTX off. Meeting audio elements are keyed per track so a presenter's mic and shared audio no longer overwrite each other; moderation and disconnect cleanup cover both.
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
2d-metaverse Ready Ready Preview Oct 22, 2026 6:41am UTC

@Anuraj-dev
Anuraj-dev merged commit 3e30cec into main Oct 22, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — b493f3c7 Deployed Oct 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant