browser
browser copied to clipboard
iPhone Safari IndexSizeError: The index is not in the allowed range
Hello,
I'm using @zxing-js/browser
library together with react-webcam
like this:
In onUserMedia
handler I'm getting a list of devices (skipped in screenshot). This is done because on iPhone I can get the list of devices only after the user accepted to use the camera.
Everything works fine, but on iPhone somethimes there is a bug when I switch between cameras.
Here are some screenshots with errors:
Also, is this a good practice to create a BrowserMultiFormatReader
instance and configure it to decodeOnceFromStream
each time when the camera is changed?
What is actually happening with the old decodeOnceFromStream
call, when a new camera is selected?
In zxing-js/library
there is a reset method, but what about zxing-js/browser
?
Do we need to reset the reader when a new camera is selected?