Live View
Live view is a WebRTC session between the app and the camera. LiveViewModel handles signalling, wakes battery cameras, renders into an IVVideoView, and carries commands — talkback, siren, two-way calling — over the data channel.
You never construct a LiveViewModel. LiveViewObjectStore keeps one per camera, so two screens showing the same camera share a single stream.
The shape of it
let liveView = LiveViewObjectStore.objectFor(
.liveView, spaceId: spaceId, deviceId: deviceId, wakeup: device.isMcuSupported
)
liveView.onConnected = { [weak self] in self?.hideSpinner() }
if let videoView = liveView.remoteViews.first {
view.addSubview(videoView)
}
liveView.connect(autoDisconnectTime: 300)
Assign callbacks before connecting, and clear them when the screen goes away — the model is cached and outlives your view controller.
In this section
| Page | Covers |
|---|---|
| Setting Up | Creating the model and its capability flags |
| Rendering Live View | Attaching the video view, connecting, observing status |
| Audio Interactions | Speaker and microphone |
| RSSI | Camera Wi-Fi signal readings |
| Two-Way Calling | Call events, accepting and disconnecting, local video |
| Recording and Snapshots | Recording the stream and capturing stills |
Product features over the data channel
Two more groups of methods on the model belong to a product line, so they are documented there:
| Method | Goes over | Product page |
|---|---|---|
startManualSiren() / stopManualSiren() | the data channel | Home Security → Alarm & Deterrence |
lullabyPlay(request:), lullabyPause(), lullabyResume(), lullabyStoped() | REST — convenience wrappers around Factory.deviceService; the stream need not be open | Baby → Lullaby |
A note on battery and data
Set autoDisconnectTime on live view. An unattended stream drains a battery camera and, on a cellular camera, the shared data pool. The value is captured only when a new connection is started — calling connect again on an already connected model does not change it — and the timer is deferred while the microphone, a recording or the siren is active. onLiveViewTerminate fires when it disconnects.