Skip to content

hd-camera

Attributes and example

hd-camera

A camera: its latest snapshot as the picture, live video over it while the tile is on screen (the host signals WebRTC with its own session, so the template never sees a token), a status pill (Live, Connecting…, Paused, Snapshot with its age, Unavailable) and, when asked, the camera’s name, a motion badge and an expand mark, over soft scrims. It streams only while visible, while the page is visible and the host allows it, never on e-ink (the snapshot only, refreshed), at most four at a time per page, and retries with backoff when a stream can’t start, showing the snapshot meanwhile. A video a browser can’t play (RTSP) isn’t tried: it shows the snapshot with a note saying so. It fills its parent and sets data-state on itself: connecting, live, paused, failed, snapshot or unavailable.

AttributeWhat it is
videoThe device’s video by name.Default snapshot.
imageThe device’s snapshot image by name, shown until the video plays and instead of it.Default snapshot.
deviceDevice id; defaults to the widget’s own device.
liveStream live video; without it, snapshots only.Default false.
labelThe camera’s name, top left; left out without it.
roomSmall text after the name, e.g. the room.
motion-nowMotion right now: the badge says so.Default false.
motion-atWhen motion was last seen (ISO); the badge says how long ago, kept up to date.
detectedWhat was seen, when the camera says (Person, Vehicle).
bareNo name and no expand mark, for the big view that has them.Default false.
bigThe big view: it streams even when other cameras use all the places.Default false.
soundPlay the camera’s sound (it is muted otherwise).Default false.
unavailableThe camera is unavailable: no streaming, greyed snapshot.Default false.
snapshot-everySeconds between snapshots while there is no live video (at least 1; a minute at least on e-ink); the snapshot is never fetched more often, however often the camera renews it.Default 10.
<hd-camera label="{{ device.name }}" room="{{ device.zoneName }}" live></hd-camera>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

hd-camera {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables