densen2014 / ZXingBlazor

Using ZXing Scan barcode/QR code in blazor
Apache License 2.0
93 stars 39 forks source link

FlashLight Compatibility #22

Closed JulienMontfort closed 1 year ago

JulienMontfort commented 1 year ago

Hello,

Is it planned to be compatible with the phone's torch? It is convenient to scan a qr code in dark places.

I use the Blazor on a MAUI application. When I turn on the flashlight with the MAUI APIs, when the ZXingBlazor componant is launched, the torch turns off automatically. When i use MAUI flashlight in other pages, no issue.

This makes me think that the ZXingBlazor component takes over the control of the light, and sets it to off by default.

What is the correct way to use the torch during the scan?

densen2014 commented 1 year ago

maui you can use the app native function for scan barcode with lights, with zxing.js maybe can not do that, :)

densen2014 commented 1 year ago

for example zxing xamarin

image

JulienMontfort commented 1 year ago

Hi densen2014,

I have allready try to ZXing.Net.MAUI but ZXingBlazor has a much better accuracy. I have not seen better.

I'll try anyway zxing xamarin.

I have seen in this link https://codepen.io/adamrifai/pen/YLxjKa but I'm not skilled enough in javascript to modify this project.

If you ever find a solution I'm interested ^^

densen2014 commented 1 year ago

for js open torch ,i need do some research , tks for your issue

densen2014 commented 1 year ago

https://github.com/sabitertan/BlazorBarcodeScanner/blob/master/BlazorBarcodeScanner.ZXing.JS/wwwroot/BlazorBarcodeScanner.js

densen2014 commented 1 year ago

@JulienMontfort can you do a test with this url? https://densen.es/test/webdev/camera/

ImageCapture.getPhotoCapabilities() => fillLightMode : Returns an array of available fill light options. Options include auto, off, or flash.

But It can only work in Chrome, because ImageCapture is only supported in Chrome and Opera

JulienMontfort commented 1 year ago

@densen2014 With your URL the flash button not work while it work with my link.

densen2014 commented 1 year ago

@densen2014 With your URL the flash button not work while it work with my link.

so torch is a very small function, not universal. i cann't do anything.