Screenshare reminders: shared window closed (black share) and long share with nobody watching #39

Closed
opened 2026-09-17 16:26:16 -04:00 by jared · 1 comment
Owner

Two cases, both from signals LiveKit already gives:

  1. Shared window closed → the track ends (ended on the MediaStreamTrack) but the tile can linger black. Stop the share cleanly and emit a host-visible notice (io.lotus.call_state flag or a dedicated action) so cinny can toast "Screenshare ended — the window was closed".
  2. Still sharing? after 30 min of sharing with no other participants in the call (everyone left) → one notice, once. Never while others are present.
    Host side (cinny) renders the toast; fork side detects.
Two cases, both from signals LiveKit already gives: 1. **Shared window closed** → the track ends (`ended` on the MediaStreamTrack) but the tile can linger black. Stop the share cleanly and emit a host-visible notice (`io.lotus.call_state` flag or a dedicated action) so cinny can toast "Screenshare ended — the window was closed". 2. **Still sharing?** after 30 min of sharing with **no other participants in the call** (everyone left) → one notice, once. Never while others are present. Host side (cinny) renders the toast; fork side detects.
jared added this to the Features 2026-Q4 milestone 2026-09-17 16:26:16 -04:00
jared added the enhancementpriority: lowuxarea: livekit labels 2026-09-17 16:26:16 -04:00
jared self-assigned this 2026-09-17 16:26:16 -04:00
Author
Owner

Done — fork e7c27dd8 + 9f472fd7 (in 0.25.0-lotus.12), cinny 2bed70d3.

Fork lotusScreenshareWatch.ts watches the local screenshare publication and sends io.lotus.screenshare_notice { kind } at most once per share each:

  • ended — the MediaStreamTrack ended (window closed). LiveKit already unpublishes the share so nothing lingers; because its handler runs first and unpublishes, the notice is also derived from readyState === "ended" on LocalTrackUnpublished.
  • no-frames — the track has been muted (minimised/occluded window) for 15 s straight.
  • alone — 30 min of sharing with remoteParticipants.size === 0, checked once a minute; never while anyone else is present.

Cinny toasts them: "Screen sharing stopped — the shared window was closed.", "Your screen share is showing nothing — the shared window may be minimised or hidden.", and a sticky "Still sharing? …". 5 unit tests (fake timers); end to end: sharing "Entire screen", stopping the source → the host toast appears.

Done — fork e7c27dd8 + 9f472fd7 (in 0.25.0-lotus.12), cinny 2bed70d3. Fork `lotusScreenshareWatch.ts` watches the local screenshare publication and sends `io.lotus.screenshare_notice { kind }` at most once per share each: - `ended` — the MediaStreamTrack ended (window closed). LiveKit already unpublishes the share so nothing lingers; because its handler runs first and unpublishes, the notice is also derived from `readyState === "ended"` on `LocalTrackUnpublished`. - `no-frames` — the track has been muted (minimised/occluded window) for 15 s straight. - `alone` — 30 min of sharing with `remoteParticipants.size === 0`, checked once a minute; never while anyone else is present. Cinny toasts them: "Screen sharing stopped — the shared window was closed.", "Your screen share is showing nothing — the shared window may be minimised or hidden.", and a sticky "Still sharing? …". 5 unit tests (fake timers); end to end: sharing "Entire screen", stopping the source → the host toast appears.
jared closed this issue 2026-09-20 15:52:30 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/element-call#39