简体   繁体   English

相机适用于所有设备的条形码扫描仪

[英]camera Barcode scanner for all devices

I am building a scavenger hunt game for a library and would like to have a feature where the player can scan the book's barcode as an input for a correct answer. 我正在为图书馆构建寻宝游戏,并且希望有一个功能,玩家可以扫描书的条形码作为输入,以获得正确答案。

I am building the app on Dreamweaver with HTML, CSS, and Javascript. 我正在使用HTML,CSS和Javascript在Dreamweaver上构建应用程序。 Is there any way for me to access the phone's camera and use it to scan a barcode, then match that barcode to a correct answer? 我有什么方法可以访问手机的相机并使用它扫描条形码,然后将该条形码与正确答案匹配? I'm not trying to find the book on Amazon or anything. 我不是想在亚马逊或其他任何地方找到这本书。

There are native libraries like ZXing and Zbar which will do that very easily for you. 有诸如ZXing和Zbar之类的本机库将为您轻松完成此操作。 But the part of the app which does the scanning will have to coded natively. 但是执行扫描的应用程序部分必须本地编码。 Web Pages cannot decode QR's. 网页无法解码QR。 If that is what you require you will need to upload a live stream of the camera footage and run a decoding logic on a server. 如果这是您的要求,则需要上传摄像机镜头的实时流,并在服务器上运行解码逻辑。 But you will be unnecessarily complicating things. 但是您将不必要地使事情复杂化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM