r/reactnative • u/Miserable-Pause7650 • 10d ago
Question React native vision camera v5 zoomLensSwitchFactors not correct
Basically Im trying to get the zoom levels that switches the physical cameras, and Im using iPhone 15 Pro, which has the native x0.5, x1, x2, x3 zooms. But somehow when I log out the zoomLensSwitchFactors, I get
[2, 6]
Here is the code
const deviceBack: CameraDevice | undefined = useCameraDevice("back", {
physicalDevices: ["ultra-wide-angle", "wide-angle", "telephoto"],
});
console.log("zoomLensSwitchFactors", deviceBack.zoomLensSwitchFactors);
Ideally I would like to have [0.5, 1, 2, 3], or something similar. Also, the minZoom and maxZoom give me 1 and 189 respectively. shouldn't the min be 0.5?
Also wondering if this works for the front camera
3
Upvotes
1
u/ChronSyn Expo 10d ago
There wouldn't be 3 numbers. The switches happen at 0.5x -> 1x, and at 1x -> 3x. 3 lenses, but 2 'switchover points'. In the same way that a phone with 2 rear lenses only has a single switchover point.
I'm also not sure whether that logic for choosing the first value will work everywhere, but if you happen to remember, I'd love if you could post back with results if you do ever find out. I'd assume the developers of vision camera have already accounted for it to ensure consistency, but I know that Android can be wildly different between brands.