docs: Add **Flash** documentation

This commit is contained in:
Marc Rousavy 2023-10-05 16:40:15 +02:00
parent 3750734578
commit 36e9e00930
No known key found for this signature in database
GPG Key ID: 8B9C709EA0B16A6D
3 changed files with 26 additions and 1 deletions

View File

@ -76,6 +76,19 @@ await camera.current.pauseRecording()
await camera.current.resumeRecording()
```
### Flash
The [`startRecording(...)`](/docs/api/classes/Camera#startrecording) function can be configured to enable the [flash](/docs/api/interfaces/RecordVideoOptions#flash) while recording, which natively just enables the [`torch`](/docs/api/interfaces/CameraProps#torch) under the hood:
```ts
camera.current.startRecording({
flash: 'on',
...
})
```
Note that flash is only available on camera devices where [`hasTorch`](/docs/api/interfaces/CameraDevice#hastorch) is `true`; for example most front cameras don't have a torch.
### Video Codec
By default, videos are recorded in the H.264 video codec which is a widely adopted video codec.

View File

@ -54,6 +54,18 @@ You can customize capture options such as [automatic red-eye reduction](/docs/ap
This function returns a [`PhotoFile`](/docs/api/interfaces/PhotoFile) which is stored in a temporary directory and can either be displayed using `<Image>` or `<FastImage>`, uploaded to a backend, or saved to the Camera Roll using [react-native-cameraroll](https://github.com/react-native-cameraroll/react-native-cameraroll).
### Flash
The [`takePhoto(...)`](/docs/api/classes/Camera#takephoto) function can be configured to enable the [flash](/docs/api/interfaces/TakePhotoOptions#flash) automatically (when the scene is dark), always or never, which will only be used for this specific capture request:
```ts
const photo = await camera.current.takePhoto({
flash: 'on' // 'auto' | 'off'
})
```
Note that flash is only available on camera devices where [`hasFlash`](/docs/api/interfaces/CameraDevice#hasflash) is `true`; for example most front cameras don't have a flash.
### Fast Capture
The [`takePhoto(...)`](/docs/api/classes/Camera#takephoto) function can be configured for faster capture at the cost of lower quality:

View File

@ -5,7 +5,7 @@ export interface RecordVideoOptions {
/**
* Set the video flash mode. Natively, this just enables the torch while recording.
*/
flash?: 'on' | 'off' | 'auto'
flash?: 'on' | 'off'
/**
* Specifies the output file type to record videos into.
*/