Skip to content

Feat/screenshare app audio sharing#33044

Open
JoaoCostaIFG wants to merge 4 commits intoelement-hq:developfrom
JoaoCostaIFG:feat/screenshare-app-audio-sharing
Open

Feat/screenshare app audio sharing#33044
JoaoCostaIFG wants to merge 4 commits intoelement-hq:developfrom
JoaoCostaIFG:feat/screenshare-app-audio-sharing

Conversation

@JoaoCostaIFG
Copy link
Copy Markdown

Checklist

Description

  • Originally submitted as PR 2880 in element-desktop
  • This adds support for streaming application audio during screenshares on Linux systems using PipeWire:
    • Mostly focusing on Wayland, but works the same on X11 as long as PipeWire is available/in use.
  • Uses venmic which is a package used by vesktop
    • Vesktop is custom 3rd party discord client
    • It allows screenshares with audio in Linux
  • Feature kept as optional:
    • Only works when in Linux, with Pipewire.
    • If venmic fails to load (outdated glibc, missing PipeWire, etc.), the screen share works normally without audio

Will help implement the feature requested in this issue: element-hq/element-call #3657.

Problems

  • I was expecting an easier/better way to load the audio source/channel/node picker dialog window
    • Open to suggestions here.
  • Venmic isn't exactly intended to be used in other apps like this, but it seems fine to me.
  • I don't have windows or macos machines to test the build, but I think the pnpm run hak will fail on non-linux systems:
    • The check step in hak modules doesn't return anything.
    • Even when venmic check step in hak "fails", it still tries to proceed with the build.

Next steps (outside the scope of this PR)

  • Screenshares currenly lack audio volume controls:
    • Need to add a volume slider for it (on the right-click menu) in element-call.
  • Get something similar working on Windows and on MacOS.

Screenshots

Audio sharing app picker:

image

Integrate @vencord/venmic for application audio capture during screen sharing
on Linux via PipeWire.

- Add audio picker dialog for selecting apps/system audio to share
- Support both Wayland (native portal) and X11 (Electron picker) paths
- Inject getDisplayMedia patch for Element Call iframe compatibility
- Build venmic as a hak native module dependency
- Add Compound Design Tokens for audio picker UI theming
Remove duplicate package declarations for matrix-seshat and
@vencord/venmic that were already managed via hakDependencies.
The optionalDependencies, pnpm overrides, and root dependencies
entries were unnecessary duplicates causing build complexity.

Also re-add New Vector Ltd. copyright to displayMediaCallback.ts.

Signed-off-by: JoaoCostaIFG <[email protected]>
…and iframe injection

- Extract shared patch logic into venmic-patch.ts
- preload.cts now imports and calls applyVenmicPatch()
- venmic-inject.ts now imports VENMIC_PATCH_SCRIPT constant
- Add cleanup handlers (stopVenmic) in iframe injection when window.electron is available
- Document cross-origin iframe limitation where venmic cannot auto-stop
@JoaoCostaIFG JoaoCostaIFG requested review from a team as code owners April 4, 2026 18:08
@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant