docs: Add **Flash** documentation
This commit is contained in:
parent
3750734578
commit
36e9e00930
@ -76,6 +76,19 @@ await camera.current.pauseRecording()
|
|||||||
await camera.current.resumeRecording()
|
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
|
### Video Codec
|
||||||
|
|
||||||
By default, videos are recorded in the H.264 video codec which is a widely adopted video codec.
|
By default, videos are recorded in the H.264 video codec which is a widely adopted video codec.
|
||||||
|
@ -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).
|
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
|
### Fast Capture
|
||||||
|
|
||||||
The [`takePhoto(...)`](/docs/api/classes/Camera#takephoto) function can be configured for faster capture at the cost of lower quality:
|
The [`takePhoto(...)`](/docs/api/classes/Camera#takephoto) function can be configured for faster capture at the cost of lower quality:
|
||||||
|
@ -5,7 +5,7 @@ export interface RecordVideoOptions {
|
|||||||
/**
|
/**
|
||||||
* Set the video flash mode. Natively, this just enables the torch while recording.
|
* 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.
|
* Specifies the output file type to record videos into.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user