CameraVideoSource
Camera video source for managing camera devices and preferred resolution.
Methods
Registers a handler for the specified event.
One event can have more than one handler; handlers are executed in order of their registration.
Parameters
eventName:
Event name
listener:
(event: AnyCameraVideoSourceEvent) => void | Promise<void>
Handler function that is triggered when an event of the specified type occurs
options:
Object that specifies characteristics about the event listener
Returns
type:
void
Removes a previously registered handler for the specified event.
Parameters
eventName:
Event name
listener:
(event: AnyCameraVideoSourceEvent) => void | Promise<void>
Handler function to remove from the event target
Returns
type:
void
Changes the CameraVideoSource.selectedDevice to the provided one.
Parameters
device:
Camera device to select
Returns
type:
Promise<void>
Sets the preferred camera resolution.
Supported values:
- CameraResolution for custom width and height
- QualityPreset for predefined quality level
The closest resolution supported by the selected camera device is chosen. Updates CameraVideoSource.preferredResolution.
Parameters
resolution:
Preferred resolution for camera
Returns
type:
void
Props
List of camera devices available on the device.
Watchable property that allows getting the preferred camera resolution and observing its changes.
The value can be:
- CameraResolution with explicit width and height
- QualityPreset when set via CameraVideoSource.setPreferredResolution
For QualityPreset, the SDK selects the closest resolution supported by the selected camera device. See CameraDevice.supportedResolutions for available resolutions.
Watchable property that allows getting the selected CameraDevice and observing its changes.