简体   繁体   English

使用Django或JS开启相机并扫描二维码

[英]Using Django or JS to turn on camera and scan QR-code

I am now working on a project that can scan QR-code which contains ID of a good.我现在正在研究一个可以扫描包含商品 ID 的二维码的项目。 Is there any method that I can have my website to switch on iPhone camera for scanning?有什么方法可以让我的网站打开 iPhone 相机进行扫描? Please give me some information about this or link.请给我一些关于这个或链接的信息。

You'd have to use some UI technology to access camera, because the part of the app your users are running is the frontend.您必须使用一些 UI 技术来访问相机,因为您的用户正在运行的应用程序部分是前端。 So, you'll have to use javascript and totally not django .因此,您必须使用 javascript而完全不是 django

There's theMediaDevices.getUserMedia() API that browsers expose.浏览器公开了MediaDevices.getUserMedia() API。

Have a look at this tutorial on how to use that.查看本教程以了解如何使用它。

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

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