Skip to content

feat: add screen sharing to Daily.co audio spaces#18

Open
bettercallzaal wants to merge 1 commit intoSongjamSpace:feat-daily-audiofrom
bettercallzaal:feat/daily-screen-share
Open

feat: add screen sharing to Daily.co audio spaces#18
bettercallzaal wants to merge 1 commit intoSongjamSpace:feat-daily-audiofrom
bettercallzaal:feat/daily-screen-share

Conversation

@bettercallzaal
Copy link
Copy Markdown
Contributor

Summary

Add screen sharing to /spaces/[farcasterUsername] rooms using Daily.co's built-in startScreenShare()/stopScreenShare() — no new dependencies.

Changes (1 file, 92 lines added)

All changes in src/app/spaces/[farcasterUsername]/page.tsx:

  • Screen share toggle button — Monitor/MonitorOff icons (lucide-react, already imported), sits between mic and end/leave controls
  • Track lifecycle handling — listens to Daily track-started/track-stopped events to detect when any participant shares their screen
  • Video display — renders shared screen above participants panel in a responsive max-h-[50vh] container with fade-in animation
  • Cleanup — stops screen share on leave to prevent orphaned streams

How it works

daily.startScreenShare()  → browser prompts screen picker
daily.stopScreenShare()   → stops sharing
daily.on('track-started') → detects remote screen shares, renders video
daily.on('track-stopped') → removes video when sharing ends

Use cases

  • Music producers sharing DAW sessions during listening parties
  • Visual artists sharing screens during creative sessions
  • Presenters sharing slides during community calls

Test plan

  • Verify screen share button appears in room controls
  • Test start/stop screen share flow
  • Verify shared screen renders for other participants
  • Test that leaving room cleans up screen share
  • Verify no regressions in mic/leave functionality

🤖 Generated with Claude Code — contributed by @bettercallzaal

Add screen share support to the /spaces/[farcasterUsername] room using
Daily.co's built-in startScreenShare()/stopScreenShare() methods.

Changes to InRoomControls component:
- Screen share toggle button (Monitor/MonitorOff icons from lucide-react)
- Track lifecycle via daily 'track-started'/'track-stopped' events
- Video element renders shared screen above participants when active
- Clean up screen share on leave

No new dependencies — uses Daily.co APIs already in the stack.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

@bettercallzaal is attempting to deploy a commit to the adamnusic's projects Team on Vercel.

A member of the Team first needs to authorize it.

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