1.6 KiB
1.6 KiB
id | title | sidebar_label | custom_edit_url | hide_title |
---|---|---|---|---|
hooks_usecameradevices | Module: hooks/useCameraDevices | hooks/useCameraDevices | null | true |
Module: hooks/useCameraDevices
Functions
useCameraDevices
▸ useCameraDevices(): CameraDevices
Gets the best available CameraDevice
. Devices with more cameras are preferred.
throws
CameraRuntimeError
if no device was found.
example
const device = useCameraDevice()
// ...
return <Camera device={device} />
Returns: CameraDevices
The best matching CameraDevice
.
Defined in: src/hooks/useCameraDevices.ts:29
▸ useCameraDevices(deviceType
: PhysicalCameraDeviceType | LogicalCameraDeviceType): CameraDevices
Gets a CameraDevice
for the requested device type.
throws
CameraRuntimeError
if no device was found.
example
const device = useCameraDevice('wide-angle-camera')
// ...
return <Camera device={device} />
Parameters:
Name | Type | Description |
---|---|---|
deviceType |
PhysicalCameraDeviceType | LogicalCameraDeviceType | Specifies a device type which will be used as a device filter. |
Returns: CameraDevices
A CameraDevice
for the requested device type.
Defined in: src/hooks/useCameraDevices.ts:44