Referencing Android issue 3027 related to Camera loosing sideProps like Zoom.
Issue: 3027 When camera is set to be active the side props needs to be reapplied as it is a known bug where zoom level gets resets on CameraX module after camera is set to inactive.
https://github.com/mrousavy/react-native-vision-camera/issues/3027
What
Android: Camera sideProps reflection on initialization and active state change
Changes
This PR adds a patch to re configure the side props whenver camera active state changes
Tested on
- Redmi 12, Android 14
- Redmi Pad Pro, Android 14
- Samsung M53, Android 13
Related issues
Fixes #3027
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-native-vision-camera | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | May 15, 2025 11:02am |
I confirm that the zoom bug mentionned in https://github.com/mrousavy/react-native-vision-camera/issues/3027 is fixed with this PR. It also fixed a similar issue with exposure.
Thanks a lot @ShivamKJJW 🙏🏻
Does this only affect zoom? Isn't this a CameraX bug then?
I appreciate the PR, but I don't want to monkey-patch broken behaviour in CameraX - this will lead to an unmaintainable mess.
We should rather file a bug report in CameraX and wait for a fix there.
I appreciate the PR, but I don't want to monkey-patch broken behaviour in CameraX - this will lead to an unmaintainable mess.
We should rather file a bug report in CameraX and wait for a fix there.
I am not sure either that it is a bug from CameraX module itself. It seems that whenever camera state changes, the extra props needs to be set again if a custom behaviour is needed. By default camera initialises with the default zoom level of the device. Seems to be default android behaviour.