feat: Add support for LiDAR, TrueDepth, External (USB) and Continuity Camera Devices (iOS 17) (#1824)
* feat: Add support for LiDAR, TrueDepth, External (USB) and Continuity Camera Devices (iOS 17) * Rename `devices` -> `physicalDevices` * fix: Comment out iOS 17 cameras for now * fix: Move `supportsDepthCapture` to `format` * fix: Fall back to `wide-angle-camera` for any unknown types * Update CameraPage.tsx * `descriptor` -> `physicalDeviceDescriptor` * Update CameraDevice.ts * Format * feat: Expose `userPreferredCameraDevice` Uses the new iOS 17 API where the user can prefer a default device, otherwise fall back to the first device of the available ones * fix: Expose as property * Add TODO comments * fix: Format code * fix: Compile below Swift 5.9
This commit is contained in:
@@ -4,6 +4,7 @@ import { CameraDevice } from './CameraDevice';
|
||||
const CameraDevicesManager = NativeModules.CameraDevices as {
|
||||
getConstants: () => {
|
||||
availableCameraDevices: CameraDevice[];
|
||||
userPreferredCameraDevice: CameraDevice | undefined;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -18,6 +19,7 @@ eventEmitter.addListener(DEVICES_CHANGED_NAME, (newDevices: CameraDevice[]) => {
|
||||
});
|
||||
|
||||
export const CameraDevices = {
|
||||
userPreferredCameraDevice: constants.userPreferredCameraDevice,
|
||||
getAvailableCameraDevices: () => devices,
|
||||
addCameraDevicesChangedListener: (callback: (newDevices: CameraDevice[]) => void) => {
|
||||
return eventEmitter.addListener(DEVICES_CHANGED_NAME, callback);
|
||||
|
||||
Reference in New Issue
Block a user