This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11import { Component } from "@angular/core" ;
2- import { MLKitScanBarcodesOnDeviceResult } from "nativescript-plugin-firebase/mlkit/barcodescanning" ;
2+ import {
3+ MLKitScanBarcodesOnDeviceResult ,
4+ MLKitScanBarcodesResultBarcode
5+ } from "nativescript-plugin-firebase/mlkit/barcodescanning" ;
36import { AbstractMLKitViewComponent } from "~/tabs/mlkit/abstract.mlkitview.component" ;
47
58@Component ( {
@@ -8,23 +11,20 @@ import { AbstractMLKitViewComponent } from "~/tabs/mlkit/abstract.mlkitview.comp
811 templateUrl : "./barcodescanning.component.html" ,
912} )
1013export class BarcodeScanningComponent extends AbstractMLKitViewComponent {
11- barcodes : Array < {
12- value : string ;
13- format : string ;
14- } > ;
14+
15+ barcodes : Array < MLKitScanBarcodesResultBarcode > ;
1516
1617 pause : boolean = false ;
1718
1819 onBarcodeScanResult ( event : any ) : void {
1920 const result : MLKitScanBarcodesOnDeviceResult = event . value ;
2021 this . barcodes = result . barcodes ;
2122
22- console . log ( "this.barcodes: " + JSON . stringify ( this . barcodes ) ) ;
23-
2423 if ( this . barcodes . length > 0 ) {
25- console . log ( "pausing the scanner for 3 seconds (to test the 'pause' feature)" ) ;
24+ console . log ( "this.barcodes: " + JSON . stringify ( this . barcodes ) ) ;
25+ console . log ( "pausing the scanner for 1 second (to show the 'pause' feature)" ) ;
2626 this . pause = true ;
27- setTimeout ( ( ) => this . pause = false , 3000 )
27+ setTimeout ( ( ) => this . pause = false , 1000 )
2828 }
2929 }
3030}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export class FaceDetectionComponent extends AbstractMLKitViewComponent {
1616 const value : MLKitDetectFacesOnDeviceResult = scanResult . value ;
1717 if ( value . faces . length > 0 ) {
1818 this . faces = value . faces ;
19+ console . log ( "this.faces: " + JSON . stringify ( this . faces ) ) ;
1920
2021 let allSmilingAndEyesOpen = true ;
2122 value . faces . forEach ( face => {
You can’t perform that action at this time.
0 commit comments