Skip to content

Commit 25eb7cb

Browse files
committed
docs: Refine docs for multi-cam a bit
1 parent 2c427e7 commit 25eb7cb

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

docs/content/docs/multi-camera.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ if (VisionCamera.supportsMultiCamSessions) {
1919

2020
### Getting Multi-Cam capable CameraDevices
2121

22-
Due to hardware constraints, not every [`CameraDevice`](/api/react-native-vision-camera/hybrid-objects/CameraDevice) can be paired with every other [`CameraDevice`](/api/react-native-vision-camera/hybrid-objects/CameraDevice) - therefore VisionCamera exposes a fixed array of supported combinations via [`CameraDeviceFactory.supportedMultiCamDeviceCombinations`](/api/react-native-vision-camera/hybrid-objects/CameraDeviceFactory#supportedmulticamdevicecombinations) upfront:
22+
Due to hardware constraints, not every [`CameraDevice`](/api/react-native-vision-camera/hybrid-objects/CameraDevice) can be paired with every other [`CameraDevice`](/api/react-native-vision-camera/hybrid-objects/CameraDevice), therefore VisionCamera exposes a list of supported device combinations via [`supportedMultiCamDeviceCombinations`](/api/react-native-vision-camera/hybrid-objects/CameraDeviceFactory#supportedmulticamdevicecombinations) upfront:
2323

2424
```ts
25-
if (!VisionCamera.supportsMultiCamSessions)
26-
return
27-
2825
const deviceFactory = await VisionCamera.createDeviceFactory()
2926
const frontAndBackCombination =
3027
deviceFactory.supportedMultiCamDeviceCombinations.find((devices) => {
@@ -42,10 +39,9 @@ const backDevice = frontAndBackCombination.find((d) => d.position === 'back')
4239

4340
### Using multiple Connections
4441

45-
Then, knowing `frontDevice` and `backDevice` can be used simultaneously in a Multi-Cam session, create the [`CameraSession`](/api/react-native-vision-camera/hybrid-objects/CameraSession), and attach the [`CameraSessionConnection`](/api/react-native-vision-camera/interfaces/CameraSessionConnection)s:
42+
Then, knowing `frontDevice` and `backDevice` can be used simultaneously in a Multi-Cam session, create the outputs and build the [`CameraSessionConnection`](/api/react-native-vision-camera/interfaces/CameraSessionConnection)s:
4643

4744
```ts
48-
const session = await VisionCamera.createCameraSession(true)
4945
const frontPreviewOutput = VisionCamera.createPreviewOutput()
5046
const frontPhotoOutput = VisionCamera.createPhotoOutput({})
5147
const backPreviewOutput = VisionCamera.createPreviewOutput()

packages/react-native-vision-camera/src/specs/inputs/CameraDeviceFactory.nitro.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CameraDeviceFactory
3939
* and a {@linkcode CameraPosition | 'back'} {@linkcode CameraDevice} are
4040
* supported to be used in a Multi-Cam {@linkcode CameraSession} - in this case,
4141
* the returned 2D Array looks something like this:
42-
* ```
42+
* ```json
4343
* [
4444
* [{ position: 'back', ... }, { position: 'front', ... }]
4545
* ]

0 commit comments

Comments
 (0)