Skip to main content

Function: useCameraDevice()

useCameraDevice(position, filter?): CameraDevice | undefined

Get the best matching Camera device that best satisfies your requirements using a sorting filter.

Parameters​

• 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 device = useCameraDevice('back', {
physicalDevices: ['wide-angle-camera']
})

Defined in​

hooks/useCameraDevice.ts:19