Need help barcode scanner app always keep camera on


#1

Hi, i have developed barcode scanner app with ionic and it works great, now working on another app to scan ticket or conference passes i want to keep camera on and scan code and verify ticket is valid or not. keep scanning tickets without opening and closing camera again and again


#2

Hey mate,

I am looking to do the same thing. I haven’t started any code yet, but the way I am looking to do it is:

  1. use cordova camera preview plugin: https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview
  2. set up an observable interval of around 250ms that snaps a photo and sends it to a scanning service
  3. use a library like quagga or jsqrcode to scan the base64 image that comes through
  4. discard if no match
  5. alert if there is a match

Hope that points you in the right direction. I’m a little concerned whether we’ll have any speed issues, but will only find out by trying eh :wink: