mrousavy / react-native-vision-camera

📸 A powerful, high-performance React Native Camera library.
https://react-native-vision-camera.com
MIT License
7.49k stars 1.09k forks source link

✨ Capture progress callbacks #3145

Closed jkaufman closed 2 months ago

jkaufman commented 2 months ago

What feature or enhancement are you suggesting?

RNVC could expose callbacks for capture progress. This would enable a refined UX with coaching for users and a more responsive shutter button. The capture lifecycle and callbacks available on Android and iOS differ, so the only expectation is to have a way of identifying when capture starts (exposure begins), capture ends, and file writing ends.

What Platforms whould this feature/enhancement affect?

iOS, Android

Alternatives/Workarounds

None.

Additional information

maintenance-hans[bot] commented 2 months ago

Guten Tag, Hans here! This is an interesting feature request for capture progress callbacks. 🍻 It would definitely improve the user experience.

Could you please provide some more details about how you envision these callbacks working, and if you have any specific scenarios in mind? Also, it would be helpful to know if you have experience with implementing similar features in other libraries or platforms.

Feel free to share any additional insights! We look forward to your thoughts.

Note: If you think I made a mistake, please ping @mrousavy to take a look.

mrousavy commented 2 months ago

Such callbacks will likely be too slow for RN events. RN events are asynchronous, they come from a different thread than the JS thread. So it will have delays.

VisionCamera already has onShutter, which is the only event you will likely need, I don't see a reason for any other intermediate events to be added, but please correct me if you think otherwise.