feat: Support tap to focus without a Preview View
What
Currently, focusing only works when using the normal Preview View. When using Skia, there is no Preview View and we cannot focus.
My idea was to move the layer point conversion method to JS, so that we can do it synchronously & instantly - either convert a view point to PreviewView coordinates, or Skia video output stream coordinates.
Unfortunately both iOS and Android do not expose matrixes that allow me to convert x/y coordinates myself.
You have to use their functions for it, and on Android it only works on the UI Thread (why do you need to dispatch to the UI thread for some number multiplication you ask? I dont know. 🤦♂️)
So now I think the only solution we have is to actually pass a prop to focus which is coordinateSystem: 'preview' | 'video'... No way around it 🤦♂️
Changes
Tested on
Related issues
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 | Aug 28, 2024 9:45am |