CameraDeviceFactory
interface CameraDeviceFactory extends HybridObjectThe CameraDeviceFactory allows getting CameraDevices,
listening to device changes, and querying extensions or preferred Cameras.
Properties
cameraDevices
readonly cameraDevices: CameraDevice[]Get a list of all devices. This list may change as camera devices get plugged in/out.
userPreferredCamera?
optional userPreferredCamera: CameraDeviceGet or set the user's default preferred camera device. Setting a device here will persist the preference between apps.
Methods
addOnCameraDevicesChangedListener()
addOnCameraDevicesChangedListener(listener: (newDevices: CameraDevice[]) => void): ListenerSubscriptionAdd a listener to be called whenever the
available cameraDevices change,
for example when an external USB Camera
gets plugged in- or out- of the Device.
getCameraForId()
getCameraForId(id: string): CameraDevice | undefinedGet the CameraDevice with the given unique
id.
If no device with the given id is found,
this method returns undefined.
getDefaultCamera()
getDefaultCamera(position: CameraPosition): CameraDevice | undefinedGet the platform's default CameraDevice
at the given CameraPosition.
getSupportedExtensions()
getSupportedExtensions(camera: CameraDevice): Promise<CameraExtension[]>Gets a list of all vendor-specific CameraExtensions
the given CameraDevice supports.
A CameraExtension can be enabled when creating
a CameraSession via configure(...).