I'm having trouble to receive any errors or results in the callback of "decodeFromVideoDevice".
This is a simplification of my code:
const reader = new BrowserMultiFormatReader(); const deviceId = '[valid device id here]' reader.decodeFromVideoDevice(deviceId, 'video', (result, err) => { console.log('test', err); if (!result) return; })
The whole code works, when the camera does not emit any errors and i can successfully scan items.
My issue is with the error-handling, as the console log with "test" does never trigger, when there is an error.
To test this, I triggered errors for "NotAllowedError: Permission denied", "NotAllowedError: Permission dismissed" and "NotReadableError: Device in use", which are all correctly recognized and logged in the console by the library code itself, but are not returned in the error callback.
My understanding is that the errors happen before the actual initialization and are this not returned.
It would be great if someone could assist me in this matter.
Thanks a lot! :)
I'm having trouble to receive any errors or results in the callback of "decodeFromVideoDevice". This is a simplification of my code:
const reader = new BrowserMultiFormatReader(); const deviceId = '[valid device id here]' reader.decodeFromVideoDevice(deviceId, 'video', (result, err) => { console.log('test', err); if (!result) return; })
The whole code works, when the camera does not emit any errors and i can successfully scan items.My issue is with the error-handling, as the console log with "test" does never trigger, when there is an error. To test this, I triggered errors for "NotAllowedError: Permission denied", "NotAllowedError: Permission dismissed" and "NotReadableError: Device in use", which are all correctly recognized and logged in the console by the library code itself, but are not returned in the error callback.
My understanding is that the errors happen before the actual initialization and are this not returned.
It would be great if someone could assist me in this matter. Thanks a lot! :)