feat/screen-share #126

Merged
nrupard merged 4 commits from feat/screen-share into main 2026-05-18 14:42:55 +02:00
Owner
No description provided.
Add a "Share screen" control to the active-call overlay that captures the user's display via getDisplayMedia and replaces the camera in the peer connection's video sender using RTCRtpSender.replaceTrack so no SDP renegotiation is needed when the call already carries video. Audio-only calls fall back to addTrack so perfect negotiation does the rest. Browser-native "Stop sharing" widgets and the in-app button both route through endScreenShare, which restores the camera if it was running before the share started or clears the sender otherwise. The camera button is gated while sharing to keep one outgoing video slot.

No backend or signaling changes: the existing opaque CallSignal relay and perfect-negotiation glare handling cover the renegotiation cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first cut used sender.replaceTrack() in a fire-and-forget shape with only a console.warn() on rejection. When the browser rejected the swap (screen-capture parameters incompatible with the camera transceiver) the sender was left transmitting the now-stopped camera track, so only the sharer saw the share locally. Await the replaceTrack promise and fall back to removeTrack + addTrack on rejection, which forces SDP renegotiation through onnegotiationneeded so the peer actually receives the screen track. Also stop the camera and update localStream only after the swap settles so we do not race a half-completed replaceTrack, and set track.contentHint = 'detail' so encoders bias toward resolution over frame rate for screen content. Bail toggleScreen early when pc is not yet up so a click during connecting cannot leak a display-capture track that goes nowhere.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(voice): add screen share to enclave voice channels
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 49s
c31262cef5
Mirror the 1:1 DM call screen-share to the full-mesh enclave voice subsystem. A new "Share screen" control sits next to the camera toggle and captures the user's display via getDisplayMedia, then propagates the screen track to every existing peer using replaceTrack with a removeTrack + addTrack fallback so a rejected swap still reaches the peer via SDP renegotiation. addLocalTracks skips the camera while a share is active so any participant who joins mid-share receives the screen track from the very first offer, not a transient camera frame followed by a renegotiation. endScreenShare reverses the swap and re-acquires the camera when it was running before the share started. The camera toggle is disabled while sharing because both compete for the same outgoing video sender.

No backend or signaling changes: the existing voice_signal relay and perfect-negotiation glare handling cover the per-peer renegotiations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/screen-share
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m35s
4f99a8a2ca
# Conflicts:
#	server/assets/call.js
#	server/templates/layout.html
nrupard deleted branch feat/screen-share 2026-05-18 14:42:55 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!126
No description provided.