ngx-scanner icon indicating copy to clipboard operation
ngx-scanner copied to clipboard

If camera already in use: AbortError: Starting video failed

Open KlausHans opened this issue 5 years ago • 2 comments

Describe the bug I found no way to catch the error if the camera ngx-scanner wants to access is already in use. It also appears in the ngx-scanner demo. The "scanError" handler does not fire in this case.

To Reproduce Steps to reproduce the behavior:

  1. Have a device with one camera e.g. Laptop
  2. Use this camera in another programm e.g. some video chat software
  3. Open the ngx-scanner demo
  4. See error in console

Expected behavior The scanner component offers an error handler to catch the error and inform the user properly.

Screenshots grafik

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Firefox 81.0

KlausHans avatar Oct 07 '20 14:10 KlausHans

Nice, what's the way you found?

odahcam avatar Oct 24 '20 15:10 odahcam

I'm seeing this error when running @zxing/browser from my Galaxy Note s10 phone. No issues from my laptop w/ an extra camera plugged in.

It occurs when swapping cameras within a 'group'. I know this is ngx-scanner but adding comment as they may be related.

So if I swap from a front to back camera on the phone, all is well, if I swap from front -> front or back -> back, they share a groupId in the videoDeviceList and fail with this error.

bcawrse avatar Jul 19 '21 15:07 bcawrse