A robot's live camera over a native video the app feeds (a WebRTC stream or a URL): Live with the latency, Stalled with the last frame's time when frames stop, Paused while the view is frozen here, connecting, offline and no-camera states; pause view, snapshot, mute and full screen; overlays drawn over the picture.
API reference
Generated from the types. Every part also takes className.
CameraFeed
- labelrequired
stringThe camera's name: "Front camera". Names the feed withsource.- source
stringThe robot it is on: "Patrol dog 7F3A".- stream
MediaStreamA WebRTC stream, set as the video'ssrcObject. The app owns the connection; the feed only shows it.- src
stringA URL the browser plays by itself (a live MP4 or WebM, or HLS where the browser supports it). Usestreamorsrc.- status
"connecting" | "live" | "offline"What the connection is doing. Defaults tolivewhen there is astreamorsrc; with neither, "No camera".- latencyMs
numberGlass-to-glass delay, measured by the app, written after "Live".- staleAfterMs
number = 2000With no new frame for this long, the feed says "Stalled" over a dimmed picture instead of freezing silently.- offlineReason
stringWhy the camera is offline, written under "Camera offline": "the robot is out of network range."- onRetry
() => voidShows "Reconnect" while offline. Without it there is no button (asrcreloads itself after a video error).- onSnapshot
(blob: Blob) => voidShows "Take snapshot": the frame on screen, drawn to a canvas, as a PNG.- audio
boolean = falseThe stream carries sound: adds Mute. It starts muted (browsers block sound until someone asks for it).- aspectRatio
number = 16 / 9Width over height, so the layout holds its size before the first frame. 16 / 9 by default.- children
ReactNodeDrawn over the picture, in a layer the size of the video box: a crosshair, detection boxes.- labels
Partial<CameraFeedLabels>