# Live Cast Control Plane (P0-P2 kickoff)

## Scope implemented

- New BE API `POST/GET .../api/live_cast.php`:
  - `create_intent`, `heartbeat` (60s KA), `join_event`
  - `GET action=active|analytics|session|list`
  - Public (no login): `session`, `join_event`, education `create_intent`/`heartbeat`
- New BE repository `LiveCastRepository` with auto-schema:
  - `live_cast_sessions`, `live_cast_join_events`
- Expiry rule: sessions without heartbeat for 60s become `expired`.
- Short links + QR per session (join + direct) via internal short-links service.
- Analytics payload includes `live_cast` section; shell label **Analytics**.
- Web pages:
  - `/live/join` — viewer entry, join_event tracking, player placeholder
  - `/live/education` — 5-minute browser screen-share demo
  - `?view=live_sessions` — session tree (read-only, auto-refresh)
- Cookie consent banner (`cookie_consent.js`) gates GA4 until user accepts.
- Mobile:
  - `LiveCastControlPlane` — start/heartbeat/stop from sender/receiver services
  - `LiveCastPeerTracker` — polls `active` sessions; green border on discovery list

## Non-goals (remaining)

- WebRTC/SFU media plane and real HTML5 playback.
- Push notification delivery (Web Push / FCM).
- Gravatar / refined avatar chrome on web lists.
- Short-link click counter migration in url-shortener submodule.

## Data model notes

`live_cast_sessions` stores owner/device/platform, state transitions, short URLs, codec/BW hints.  
`live_cast_join_events` stores open/join/leave events with platform/channel/direct flags and basic anon dimensions.

## Follow-up phases

1. Integrate SFU/web viewer when media-plane branch is ready.
2. Browser/mobile notification fan-out on cast start.
3. Gravatar + green-border on web peer lists.
4. Shortener click stats joined into live session analytics.
