Live view over WebRTC (openpanel L1, server and browser)
A device reporting a `live` port streams its camera to the browser's own
RTCPeerConnection. The flows socket carries the signalling as text, so it
crosses the portal: `live` messages on a person's socket, `signal` on a
device's (start, sdp, candidate, bye, busy). The server routes by session,
holds a device to two viewers, ends a session when either socket closes or
no answer comes within 10 s, and gives each socket an outbox of its own
that ends a session rather than drop a message. TURN credentials are
minted per session in coturn's REST scheme (STUN_URLS, TURN_URLS,
TURN_SECRET), the viewer's with the device's offer; GET /devices/{id}/ice
hands them out too. The tunnel keeps a stream's early frames instead of
dropping them past eight and forgets them when the stream or link goes.
A media tile on a device's camera, and the Devices tab's preview, play
live when tapped, pause frames meanwhile, and fall back to frames with a
short note on busy, failure or no picture within 10 s. coturn is an
optional compose service behind the `turn` profile.
This commit is contained in:
@@ -189,6 +189,24 @@ under Docker, raise `shm_size` with the ring size.
|
||||
|
||||
See [Agents over MCP](../code/agents.md).
|
||||
|
||||
## Live view
|
||||
|
||||
A camera's [live view](../interface/dashboards.md#live-view) connects the
|
||||
browser and the device directly. These name the servers that help when the two
|
||||
are on different networks. Unset, only direct connections are tried, and no
|
||||
third party learns who watches what.
|
||||
|
||||
| Variable | Default | Purpose |
|
||||
|---|---|---|
|
||||
| `STUN_URLS` | unset | STUN servers, comma separated, such as `stun:turn.example.com:3478` |
|
||||
| `TURN_URLS` | unset | TURN relays, comma separated, such as `turn:turn.example.com:3478,turns:turn.example.com:5349?transport=tcp` |
|
||||
| `TURN_SECRET` | unset | the secret shared with the TURN server (coturn's `static-auth-secret`); TURN is used only with it |
|
||||
|
||||
Each viewer and device gets TURN credentials of its own per live view, good for
|
||||
an hour, which coturn checks against the shared secret. A view relayed through
|
||||
TURN therefore ends after an hour. coturn also answers STUN, so one server
|
||||
covers both.
|
||||
|
||||
## Mail and monitoring
|
||||
|
||||
Password-reset mail requires `SMTP_HOST` and `EMAILS_FROM_EMAIL`.
|
||||
|
||||
Reference in New Issue
Block a user