Jump to content

Scan 1D/2D Code from Video Camera


Sherzod

Recommended Posts

Hello!

This example shows how to scan any supported 1D/2D code with ZXing javascript library from the device video camera...

This is an approximate implementation and may need to improve the code :) 

The main scan implementation is taken from here: https://zxing-js.github.io/library/examples/multi-camera/

You also need to add the files: libeay32.dll, ssleay32.dll and pem files to the root directory...

UniServerModule -> CustomFiles:

files/zxing.min.js

BarcodeScannerZxingJS.rar

  • Like 4
  • Upvote 4
Link to comment
Share on other sites

  • 3 months later...
1 hour ago, brunomf01 said:

image.png.8d23b4cc671004629f66c5e70aff3d93.png

 

On 11/12/2019 at 10:56 AM, Sherzod said:

I mean, the example uses SSL, without SSL, in short, you cannot use the camera...

 

On 11/11/2019 at 12:28 PM, Sherzod said:

You also need to add the files: libeay32.dll, ssleay32.dll and pem files to the root directory...

 

Link to comment
Share on other sites

  • 10 months later...

Библиотеки добавил, сертификаты самоподписанные создал как мануале, кинул все в корневой каталог, но все равно вот такая обишка:
image.png.08e2f42785b8287c096601d264f0739a.png

Что это может быть?

Link to comment
Share on other sites

12 minutes ago, Kenneth said:

Библиотеки добавил, сертификаты самоподписанные создал как мануале, кинул все в корневой каталог, но все равно вот такая обишка:
image.png.08e2f42785b8287c096601d264f0739a.png

 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
On 11/11/2019 at 3:28 PM, Sherzod said:

你好!

此示例显示如何从设备摄像机中使用 ZXing javascript 库扫描任何支持的 1D/2D 代码...

这是一个大致的实现,可能需要改进代码:) 

主要扫描实现取自此处:https://zxing-js.github.io/library/examples/multi-camera/

您还需要将文件添加:libeay32.dll,ssleay32.dll和pem文件到根目录。。。

统一服务模式 - • 自定义文件:


files/zxing.min.js

条形码扫描器.rar不能利用的

 

On 11/11/2019 at 3:28 PM, Sherzod said:

你好!

此示例显示如何从设备摄像机中使用 ZXing javascript 库扫描任何支持的 1D/2D 代码...

这是一个大致的实现,可能需要改进代码:) 

主要扫描实现取自此处:https://zxing-js.github.io/library/examples/multi-camera/

您还需要将文件添加:libeay32.dll,ssleay32.dll和pem文件到根目录。。。

统一服务模式 - • 自定义文件:


files/zxing.min.js

条形码扫描器.rar不能利用的

When the two-dimensional code information contains Chinese, the parsing result is garbled. How to make JS support Chinese?

Link to comment
Share on other sites

22 hours ago, f172515968 said:

When the two-dimensional code information contains Chinese, the parsing result is garbled. How to make JS support Chinese?

Hello,

How did you check this?

And please specify which edition and build of uniGUI are you using?

Link to comment
Share on other sites

  • 1 year later...
  • 4 months later...

I try it ,But Has this Error.

O1F._ael=document.getElementById("player");O1F._ael.load();O1F.oldResultText="";let selectedDeviceId;    const codeReader = new ZXing.BrowserMultiFormatReader();    codeReader.getVideoInputDevices()      .then((videoInputDevices) => {        const sourceSelect = document.getElementById("sourceSelect");        selectedDeviceId = videoInputDevices[0].deviceId;        if (videoInputDevices.length >= 1) {          videoInputDevices.forEach((element) => {            const sourceOption = document.createElement("option");            sourceOption.text = element.label;            sourceOption.value = element.deviceId;            sourceSelect.appendChild(sourceOption);          });          sourceSelect.onchange = () => {            selectedDeviceId = sourceSelect.value;          };          const sourceSelectPanel = document.getElementById("sourceSelectPanel");          sourceSelectPanel.style.display = "block";        }        document.getElementById("O17_id").addEventListener("click", () => {          codeReader.decodeFromVideoDevice(selectedDeviceId, "video", (result, err) => {            if (result&&result.text!=O1F.oldResultText) {              window.ajaxRequest(O1F, "getResult", ["result="+result.text]);O1F.oldResultText=result.text;            }            if (err && !(err instanceof ZXing.NotFoundException)) {            }          });        });        document.getElementById("O1B_id").addEventListener("click", () => {          codeReader.reset();          ajaxRequest(O1F, "getResult", ["result="+""]);        })      })      .catch((err) => {        alert(err)      });

Regards.

Error1.jpg

Link to comment
Share on other sites

Hi Sherzood

I found my error and the example is running.

But when run the sample and click on start or reset button,the below error shows.

I use it for Desktop.

My licence is for Desktop,and I can´t run your sample.

I open your sample by notepad.Probably I have not set a properties.

Regards.

Err.jpg

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...