ngx-scanner
ngx-scanner copied to clipboard
If camera already in use: AbortError: Starting video failed
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:
- Have a device with one camera e.g. Laptop
- Use this camera in another programm e.g. some video chat software
- Open the ngx-scanner demo
- See error in console
Expected behavior The scanner component offers an error handler to catch the error and inform the user properly.
Screenshots

Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox 81.0
Nice, what's the way you found?
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.