You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like this grabs an image from a HtmlVideoElement and passes to the bardecoder crate for decoding (not sure I entirely understand how the HtmlVideoElement gets its image.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
Crazy idea maybe, but I would like a wasm front end written in dioxus to be able to prompt the user to scan a barcode.
Not sure where to start... Or if this is feasible.
I guess there are two distinct steps:
For step 2, It looks like there is on official detection API, https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API
But by the looks of it browser support might be limited. Not sure if Mobile firefox on Android supports it, might be limited to Chrome on Android.
Then somebody has written a component for yew: https://gitlab.com/voltfang-public/yew-scanner
Code here: https://gitlab.com/voltfang-public/yew-scanner/-/blob/main/src/lib.rs?ref_type=heads
It looks like this grabs an image from a
HtmlVideoElement
and passes to the bardecoder crate for decoding (not sure I entirely understand how theHtmlVideoElement
gets its image.https://github.com/piderman314/bardecoder
But it does certain things which I am not sure of in Dioxus, e.g. grabbing references to rendered html elements.
Then there is some JavaScript code:
https://stackoverflow.com/questions/67078359/barcode-scanning-via-mobile-browser
And I see this library looks like it might have Camera support in the future, but isn't quite there yet:
https://github.com/DioxusLabs/sdk
Any suggestions on which approach I should take?
Beta Was this translation helpful? Give feedback.
All reactions