Scan barcode (code39) failed in iPhone #614
Unanswered
minshinehung
asked this question in
Q&A
Replies: 3 comments
-
Please share the example of the code. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi minhaz
Thanks for getting back to me.
1.The results in Android / iPhone are as attached.In iPhone camera opened, but seems scan not working.
2.The code as followed
<script src="/_other/js/html5-qrcode.min.js"></script>
<script>
$(document).ready(function(){
var lastMessage;
var codeId = 0;
function onScanSuccess(decodedText, decodedResult) {
/**
* If you following the code example of this page by looking at the
* source code of the demo page - good job!!
*
* Tip: update this function with a success callback of your choise.
*/
if (lastMessage !== decodedText) {
//alert( decodedText );
$("#id_type").html( "參數內容 = " + $("input[name='hi_type']").val() );
$("#id_user_name").html( "使用者名稱 = " + $("input[name='hi_user_name']").val() );
$("#id_barcode").html( "條碼資訊 = " + decodedText );
Swal.fire({
html: "掃碼成功 !" + "<br>條碼資訊 = " + decodedText,
allowOutsideClick: false ,
type: "success"
}).then(
function () {
return;
}
);
}
}
var qrboxFunction = function(viewfinderWidth, viewfinderHeight) {
// Square QR Box, with size = 80% of the min edge.
var minEdgeSizeThreshold = 250;
var edgeSizePercentage = 0.75;
var minEdgeSize = (viewfinderWidth > viewfinderHeight) ?
viewfinderHeight : viewfinderWidth;
var qrboxEdgeSize = Math.floor(minEdgeSize * edgeSizePercentage);
if (qrboxEdgeSize < minEdgeSizeThreshold) {
if (minEdgeSize < minEdgeSizeThreshold) {
return {width: minEdgeSize, height: minEdgeSize};
} else {
return {
width: minEdgeSizeThreshold,
height: minEdgeSizeThreshold
};
}
}
return {width: qrboxEdgeSize, height: qrboxEdgeSize};
}
const html5QrcodeScanner = new Html5QrcodeScanner(
"reader",
{
fps: 10,
qrbox: qrboxFunction,
// Important notice: this is experimental feature, use it at your
// own risk. See documentation in
// mebjas@/html5-qrcode/src/experimental-features.ts
experimentalFeatures: {
useBarCodeDetectorIfSupported: true
},
rememberLastUsedCamera: true,
showTorchButtonIfSupported: true
});
html5QrcodeScanner.render(onScanSuccess);
})
</script>
Best Regards
min
======================================================
…________________________________
寄件者: minhaz ***@***.***>
寄件日期: 2022年11月19日 下午 10:43
收件者: mebjas/html5-qrcode ***@***.***>
副本: minshinehung ***@***.***>; Author ***@***.***>
主旨: Re: [mebjas/html5-qrcode] Scan barcode (code39) failed in iPhone (Discussion #614)
Please share the example of the code.
—
Reply to this email directly, view it on GitHub<#614 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4GMTWJVR7XLZOOJ4Y3TRIDWJDRPPANCNFSM6AAAAAASFGETRQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi minhaz
This is our test page, you can test it , barcode type is code39
https://meeting.csie.ntnu.edu.tw/c_html5qrcode_direct_03
Thanks for your help
Best Regards
min
======================================================
祺欣科技有限公司 洪明賢
Tel:02-2311-6949
***@***.***
Address:台北市忠孝西路一段27號4樓
…________________________________
寄件者: minhaz ***@***.***>
寄件日期: 2022年11月19日 下午 10:43
收件者: mebjas/html5-qrcode ***@***.***>
副本: minshinehung ***@***.***>; Author ***@***.***>
主旨: Re: [mebjas/html5-qrcode] Scan barcode (code39) failed in iPhone (Discussion #614)
Please share the example of the code.
—
Reply to this email directly, view it on GitHub<#614 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A4GMTWJVR7XLZOOJ4Y3TRIDWJDRPPANCNFSM6AAAAAASFGETRQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Scan barcode (code39) succeeds in Android. But failed on iPhone. No response.
Beta Was this translation helpful? Give feedback.
All reactions