qr-scanner
qr-scanner copied to clipboard
camera fails with unhandled promise when used from two browsers
Cameras cannot be used more than once, so an error is thrown when I use a camera from firefox and then from chrome (in your demo)
This is a silly use case, but it does generate an error and should be fixed.
The easiest way to sort this out I think is to return the promise from setCamera. That way I can handle it gracefully if setCamera fails. Alternately when listing cameras, either do not return cameras that are in use (not sure this is possible) or return an in use flag (again not sure).