webrtc-qr icon indicating copy to clipboard operation
webrtc-qr copied to clipboard

Shape Detection API on the horizon

Open TomasHubelbauer opened this issue 5 years ago • 1 comments

Hi, you might be interested to know that the Shape Detection API is now under a flag in Google Chrome: https://www.chromestatus.com/feature/4757990523535360

I follow this because I have implemented exactly the same project as you have here before and I found yours when you posted it on Hacker News and I really liked it because it was much cleaner than my version!

Once this API hits global availability, it should be possible to replace react-qr-reader with it, or more realistically (to not demolish support), to use it if it is available and fall back onto react-qr-reader if it isn't. Theoretically, it should be much faster and energy efficient than the JS-based QR code reader as it is a browser API backed by native code. Also, it should work in a web worker!

Hope you don't mind this random drop-in, curious to hear what you think of this API.

TomasHubelbauer avatar Aug 04 '20 21:08 TomasHubelbauer

@TomasHubelbauer nice! Thanks for the quick lines (feel free to drop-in anytime). I see it will include barcode reading which is something I have been using for a side project. Definitely a good thing to improve performance (no need to do the extra operations on JS land if these can be done closer to the hardware/natively).

I'll keep an eye out when this gets released, potentially a new module that offers the native behavior (if available) with fallback to react-qr-reader would be sweet.

AquiGorka avatar Aug 06 '20 07:08 AquiGorka