Skip to main content

Function: getCameraDevice()

getCameraDevice(devices, position, filter): CameraDevice | undefined

Get the best matching Camera device that best satisfies your requirements using a sorting filter, or undefined if devices does not contain any devices.

Parameters​

• devices: CameraDevice[]

• position: CameraPosition

The position of the Camera device relative to the phone.

• filter: DeviceFilter = {}

The filter you want to use. The Camera device that matches your filter the closest will be returned

Returns​

CameraDevice | undefined

The Camera device that matches your filter the closest, or undefined if no such Camera Device exists on the given position.

Example​

const devices = Camera.getAvailableCameraDevices()
const device = getCameraDevice(devices, 'back', {
physicalDevices: ['wide-angle-camera']
})

Defined in​

devices/getCameraDevice.ts:38