Skip to content

@camera.ui/sdk / camera / CameraDevice

Interface: CameraDevice ​

Defined in: camera/device.ts:86

Main camera device interface. Provides access to camera streams, sensors, and services.

Properties ​

connected ​

readonly connected: boolean

Defined in: camera/device.ts:134

Whether camera is connected.


detectionSettings ​

readonly detectionSettings: CameraDetectionSettings

Defined in: camera/device.ts:110

Detection settings.


disabled ​

readonly disabled: boolean

Defined in: camera/device.ts:94

Whether camera is disabled.


frameWorkerConnected ​

readonly frameWorkerConnected: boolean

Defined in: camera/device.ts:136

Whether frame worker is connected.


frameWorkerSettings ​

readonly frameWorkerSettings: CameraFrameWorkerSettings

Defined in: camera/device.ts:118

Frame worker settings.


highResolutionSource ​

readonly highResolutionSource: CameraDeviceSource | undefined

Defined in: camera/device.ts:126

High resolution source (if available).


id ​

readonly id: string

Defined in: camera/device.ts:88

Unique camera ID.


info ​

readonly info: CameraInformation

Defined in: camera/device.ts:104

Camera hardware information.


interfaceSettings ​

readonly interfaceSettings: CameraUiSettings

Defined in: camera/device.ts:120

UI display settings.


isCloud ​

readonly isCloud: boolean

Defined in: camera/device.ts:106

Whether camera streams from cloud.


logger ​

readonly logger: LoggerService

Defined in: camera/device.ts:144

Logger service for this camera.


lowResolutionSource ​

readonly lowResolutionSource: CameraDeviceSource | undefined

Defined in: camera/device.ts:130

Low resolution source (if available).


midResolutionSource ​

readonly midResolutionSource: CameraDeviceSource | undefined

Defined in: camera/device.ts:128

Mid resolution source (if available).


name ​

readonly name: string

Defined in: camera/device.ts:96

Camera display name.


nativeId ​

readonly nativeId: string | undefined

Defined in: camera/device.ts:90

Native device ID from plugin.


onConnected ​

readonly onConnected: Observable<boolean>

Defined in: camera/device.ts:138

Observable for connection state changes.


onDetectionEvent ​

readonly onDetectionEvent: Observable<{ event: DetectionEvent; type: DetectionEventType; }>

Defined in: camera/device.ts:142

Observable for detection events. Segments ride on the 'segment-*' messages only, thumbnails on 'segment-start' and 'segment-end'.


onFrameWorkerConnected ​

readonly onFrameWorkerConnected: Observable<boolean>

Defined in: camera/device.ts:140

Observable for frame worker state changes.


pluginInfo ​

readonly pluginInfo: CameraPluginInfo | undefined

Defined in: camera/device.ts:92

Source plugin information.


ptzAutotrack ​

readonly ptzAutotrack: PtzAutotrackSettings

Defined in: camera/device.ts:112

PTZ autotracking settings.


recordingSettings ​

readonly recordingSettings: CameraRecordingSettings

Defined in: camera/device.ts:114

Recording settings.


room ​

readonly room: string

Defined in: camera/device.ts:98

Room this camera belongs to.


snapshotSettings ​

readonly snapshotSettings: SnapshotSettings

Defined in: camera/device.ts:102

Snapshot settings.


snapshotSource ​

readonly snapshotSource: CameraSource | undefined

Defined in: camera/device.ts:132

Snapshot source (if available).


snooze ​

readonly snooze: boolean

Defined in: camera/device.ts:116

Whether detections are snoozed (paused).


sources ​

readonly sources: CameraDeviceSource[]

Defined in: camera/device.ts:122

All video sources.


streamSource ​

readonly streamSource: CameraDeviceSource

Defined in: camera/device.ts:124

Primary streaming source.


type ​

readonly type: CameraType

Defined in: camera/device.ts:100

Camera type (camera/doorbell).


zones ​

readonly zones: CameraZones

Defined in: camera/device.ts:108

Zone configurations, one list per purpose.

Methods ​

addSensor() ​

addSensor<T>(sensor): Promise<void>

Defined in: camera/device.ts:196

Register a sensor that belongs to this camera's hardware (spotlight, siren, PTZ, battery, ...). The host assigns it to this camera and reconciles it across restarts like a standalone sensor.

Registering here declares "this sensor belongs to this camera and no other": the assignment is locked, users cannot re-assign it. Sensors the user should assign freely are standalone: they exist once the user adopted them from a SensorDiscoveryProvider, a plugin never registers them itself.

Type Parameters ​

T ​

T extends object

Parameters ​

sensor ​

Sensor<T>

Sensor instance to register

Returns ​

Promise<void>


connect() ​

connect(): Promise<void>

Defined in: camera/device.ts:168

Tell the server this camera is online. Only the plugin that owns this camera (via pluginInfo) may connect it.

Returns ​

Promise<void>


createStorage() ​

createStorage<T>(schemas): DeviceStorage<T>

Defined in: camera/device.ts:162

Create storage for plugin-specific camera configuration.

Type Parameters ​

T ​

T extends Record<string, any> = Record<string, any>

Parameters ​

schemas ​

JsonSchema[]

Schema definitions for the storage

Returns ​

DeviceStorage<T>

Typed device storage instance


disconnect() ​

disconnect(): Promise<void>

Defined in: camera/device.ts:174

Tell the server this camera is offline. Only the plugin that owns this camera (via pluginInfo) may disconnect it.

Returns ​

Promise<void>


getSourceById() ​

getSourceById(id): CameraDeviceSource | undefined

Defined in: camera/device.ts:153

Get a source by its ID.

Parameters ​

id ​

string

The source ID

Returns ​

CameraDeviceSource | undefined

The matching source, or undefined if not found


implement() ​

implement(impl): Promise<void>

Defined in: camera/device.ts:212

Register a camera implementation for streaming and/or snapshot. The impl value should implement StreamingInterface, SnapshotInterface, or both.

Parameters ​

impl ​

CameraImplementation

Object or class implementing camera interfaces

Returns ​

Promise<void>


onPropertyChange() ​

onPropertyChange<T>(property): Observable<{ newData: Camera[T]; oldData: Camera[T]; property: T; }>

Defined in: camera/device.ts:183

Observe camera property changes.

Type Parameters ​

T ​

T extends keyof Camera

Parameters ​

property ​

T | T[]

Property name(s) to observe

Returns ​

Observable<{ newData: Camera[T]; oldData: Camera[T]; property: T; }>

Observable emitting old and new values


removeSensor() ​

removeSensor(sensorId): Promise<void>

Defined in: camera/device.ts:204

Unregister a sensor this plugin registered on this camera. The persisted entity stays (shows disconnected) unless the user deletes it.

Parameters ​

sensorId ​

string

ID of sensor to unregister

Returns ​

Promise<void>