Skip to content

feat: interactive screen share — drag, resize, minimize + camera PiP#23

Open
bettercallzaal wants to merge 1 commit intoSongjamSpace:mainfrom
bettercallzaal:feat/interactive-screen-share
Open

feat: interactive screen share — drag, resize, minimize + camera PiP#23
bettercallzaal wants to merge 1 commit intoSongjamSpace:mainfrom
bettercallzaal:feat/interactive-screen-share

Conversation

@bettercallzaal
Copy link
Copy Markdown
Contributor

Problem

Screen share display is static — viewers can't move it, resize it, or minimize it. No way to show your camera alongside the screen share. For music producers sharing DAWs or artists doing visual demos, viewers need control over how they watch.

Solution

New InteractiveMediaOverlay component (315 lines, zero new dependencies) replaces the static video block.

3 View Modes

  • Maximized — inline 16:9 block above controls (default). Best for focused viewing.
  • Floating — draggable + resizable window. Drag the header to reposition, resize from bottom-right corner. Good for multitasking while watching.
  • Minimized — collapses to a small blue pill at bottom-right. Click to restore. For when you want to keep listening but free up screen space.

Camera Picture-in-Picture

  • Host/speakers can toggle their camera from the overlay header bar or the MiniSpaceBanner
  • Camera renders as a small (140x105px) draggable window INSIDE the screen share
  • Can be repositioned independently by dragging
  • Uses hmsActions.setLocalVideoEnabled() + attachVideo() for the local video track
  • Shows "You" label on the PiP

Header Controls

Camera toggle | Float/Maximize toggle | Minimize | LIVE badge

Technical

  • Pure mouse + touch event handlers — no external drag library needed
  • Position/size clamped to viewport boundaries
  • Touch-compatible for mobile
  • Camera cleaned up on leave (setLocalVideoEnabled(false))

Files Changed (3 files, 377 lines)

File Lines What
src/components/InteractiveMediaOverlay.tsx +315 New component — all drag/resize/PiP logic
src/components/LiveAudioRoom.tsx +40 Camera state/handler, swap static block for InteractiveMediaOverlay
src/components/MiniSpaceBanner.tsx +22 Camera toggle button + props

Test plan

  • Screen share starts in maximized mode (16:9, above controls)
  • Click float button → window becomes draggable, can reposition by dragging header
  • Resize from bottom-right corner in floating mode
  • Click minimize → collapses to blue pill, click pill → restores
  • Click maximize → back to inline mode
  • Toggle camera → PiP appears inside screen share with "You" label
  • Drag camera PiP to reposition within the screen share
  • Toggle camera off → PiP disappears
  • Leave room → camera turns off cleanly
  • Test on mobile — touch drag/resize works

🤖 Generated with Claude Code — contributed by @bettercallzaal

Replace the static screen share display with an interactive overlay
that gives viewers full control over how they watch.

New component: InteractiveMediaOverlay.tsx (315 lines, zero dependencies)

3 view modes:
- MAXIMIZED: inline 16:9 block above controls (default when sharing starts)
- FLOATING: draggable + resizable window, repositioned by dragging the header
- MINIMIZED: small blue pill at bottom-right, click to restore

Camera picture-in-picture:
- Host/speakers can toggle camera from the overlay header or MiniSpaceBanner
- Camera renders as a small draggable PiP window inside the screen share
- Uses hmsActions.setLocalVideoEnabled() + attachVideo() for the local track
- Camera PiP can be repositioned independently within the screen share view

Controls in the header bar:
- Camera toggle (green = on)
- Float button (switch to draggable mode)
- Maximize button (back to inline mode)
- Minimize button (collapse to pill)
- LIVE badge

Implementation:
- Pure mouse/touch event handlers (no external drag library)
- Clamps position to viewport boundaries
- Resize handle in bottom-right corner (floating mode)
- Touch-compatible for mobile

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

vercel bot commented Mar 25, 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