@camera.ui/sdk / plugin / DiscoveryProvider
Interface: DiscoveryProvider ​
Defined in: plugin/interfaces.ts:262
Implemented by plugins that can scan the network for new cameras and adopt them. Only plugins with a camera-controlling role (CameraController or CameraAndSensorProvider) are queried for discovery.
Methods ​
onAdoptCamera() ​
onAdoptCamera(
camera,cameraSettings):Promise<CameraConfig>
Defined in: plugin/interfaces.ts:293
Probe the device with the user-provided settings and return the camera configuration the host should persist. The host then creates the camera and invokes onCameraAdded() on the plugin.
Parameters ​
camera ​
The discovered camera being adopted.
cameraSettings ​
Record<string, unknown>
Values entered into the adoption form.
Returns ​
Promise<CameraConfig>
Final camera configuration for the host to persist.
onDiscoverCameras() ​
onDiscoverCameras():
Promise<DiscoveredCamera[]>
Defined in: plugin/interfaces.ts:270
Scan the network and return the cameras the plugin can offer for adoption. Called by the host on demand (UI rescan button) or on a polling schedule.
Returns ​
Promise<DiscoveredCamera[]>
Cameras currently discoverable by this plugin.
onGetCameraSettings() ​
onGetCameraSettings(
camera):Promise<JsonSchemaWithoutCallbacks[]>
Defined in: plugin/interfaces.ts:280
Return a JSON schema describing the form fields (credentials, transport options, ...) the user must fill in to adopt this discovered camera.
Parameters ​
camera ​
The discovered camera the user is about to adopt.
Returns ​
Promise<JsonSchemaWithoutCallbacks[]>
Schema for the adoption form.