Re-working the API library functions and files

This commit is contained in:
Scott Idem
2024-05-23 18:20:31 -04:00
parent fa58d1accb
commit 42fef3feb8
17 changed files with 1797 additions and 92 deletions

View File

@@ -65,7 +65,7 @@ onMount(() => {
// navigator.mediaDevices.getUserMedia({video: true})
// .then(get_user_media_success, get_user_media_error);
// console.log('** Element Mounted: ** QR Scanner - getUserMedia in setTimeout');
// console.log('** Element Mounted: ** QR Scanner - getUserMedia in setTimeout');
});
@@ -93,7 +93,7 @@ var get_user_media_success = function(error: any) {
// document.getElementById('qr_scanner_viewfinder').classList.remove('d_none');
} else {
console.log('html5_qr_code not found. Creating new Html5Qrcode...');
debug_info = 'html5_qr_code not found. Creating new Html5Qrcode...';
debug_info = 'html5_qr_code not found. Creating new Html5Qrcode...';
html5_qr_code = new Html5Qrcode(
'qr_scanner_viewfinder', { formatsToSupport: [ Html5QrcodeSupportedFormats.QR_CODE ] }
@@ -103,7 +103,7 @@ var get_user_media_success = function(error: any) {
// html5_qr_code = new Html5Qrcode(
// 'qr_scanner_viewfinder', { formatsToSupport: [ Html5QrcodeSupportedFormats.QR_CODE ] }
// );
debug_info = 'new Html5Qrcode for element id=qr_scanner_viewfinder';
if (start_qr_scanner && 1==2) {
@@ -111,10 +111,10 @@ var get_user_media_success = function(error: any) {
debug_comment = 'Starting QR after 500ms...';
debug_info = 'Ready to start QR scanning! (after 2500ms)';
setTimeout(() => {
console.log('Inside QR scanning timeout after x500ms...');
console.log('Inside QR scanning timeout after x500ms...');
handle_start_qr_scanning_trust();
}, 2500);
console.log('Started QR scanning after x500ms...');
console.log('Started QR scanning after x500ms...');
}
// let subject = 'Camera Access Allowed';
@@ -174,7 +174,7 @@ async function handle_start_qr_scanning_trust() {
debug_comment = 'Starting trusting QR scanning...';
debug_info = 'Just start!';
debug_info = 'Just start!';
await html5_qr_code.clear();
html5_qr_code.start({ facingMode: qr_facing_mode }, qr_scan_cfg, handle_qr_scan_success, handle_qr_scan_error)
.then((ignore: any) => {
@@ -378,7 +378,7 @@ function send_init_confirm_email(subject, message) {
<span class="fas fa-qrcode mx-1"></span>
Start Scanning
</button>
<!-- <button
on:click={ () => {
html5_qr_code.start({ facingMode: { exact: "environment"} }, config, qrCodeSuccessCallback);
@@ -389,8 +389,8 @@ function send_init_confirm_email(subject, message) {
</button> -->
{#if (scanning_status == 'scanning')}
<button
on:click={handle_stop_qr_scanning}
<button
on:click={handle_stop_qr_scanning}
class="ae_btn__stop btn btn-sm variant-soft-secondary"
>
<span class="fas fa-crosshairs fa-spin opacity-50 m-1"></span>