@camera.ui/sdk / plugin / PluginAPI
Interface: PluginAPI
Defined in: plugin/api.ts:30
The PluginAPI is injected into the plugin at runtime and exposes the system services the plugin is allowed to talk to. It also acts as an EventEmitter for plugin lifecycle events (see API_EVENT).
Example
import { BasePlugin } from '@camera.ui/sdk';
export default class MyPlugin extends BasePlugin {
async configureCameras() {
const ffmpeg = await this.api.coreManager.getFFmpegPath();
}
}Properties
coreManager
readonlycoreManager:CoreManager
Defined in: plugin/api.ts:32
System-level operations: the FFmpeg path and the server addresses used for media URLs (HTTP/RTSP).
deviceManager
readonlydeviceManager:DeviceManager
Defined in: plugin/api.ts:34
Owns the camera devices assigned to this plugin and publishes camera-state changes.
downloadManager
readonlydownloadManager:DownloadManager
Defined in: plugin/api.ts:38
Mints token-protected download URLs for files the plugin exposes to the UI (clip exports, snapshots).
notificationManager
readonlynotificationManager:NotificationManager
Defined in: plugin/api.ts:40
Publishes notifications to every installed notifier and the in-app UI. Requires PluginCapability.PublishNotifications.
sensorManager
readonlysensorManager:SensorManager
Defined in: plugin/api.ts:36
Registers standalone sensors: entities of their own, persisted across restarts, assignable to cameras by the user.
storagePath
readonlystoragePath:string
Defined in: plugin/api.ts:42
Absolute path to the plugin's writable storage directory, created and cleaned up by the host.
Methods
off()
off(
event,listener):this
Defined in: plugin/api.ts:49
Remove a previously registered listener (alias of removeListener).
Parameters
event
listener
() => void
Returns
this
on()
on(
event,listener):this
Defined in: plugin/api.ts:45
Subscribe to a lifecycle event. Returns this for chaining.
Parameters
event
listener
() => void
Returns
this
once()
once(
event,listener):this
Defined in: plugin/api.ts:47
Subscribe to a lifecycle event for one delivery only.
Parameters
event
listener
() => void
Returns
this
removeAllListeners()
removeAllListeners(
event?):this
Defined in: plugin/api.ts:53
Remove every listener for event, or every listener when no event is given.
Parameters
event?
Returns
this
removeListener()
removeListener(
event,listener):this
Defined in: plugin/api.ts:51
Remove a previously registered listener.
Parameters
event
listener
() => void
Returns
this