Barcode Capture Listener
Defined under the namespace Scandit.Datacapture.Barcode
- BarcodeCaptureListener
interface BarcodeCaptureListener
Added in version 6.13.0
Listener interface for traditional barcode capture.
- didScan(barcodeCapture, session, frameData)
didScan?: (barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession, frameData: FrameData) =>
void
Added in version 6.13.0
Invoked whenever a code has been scanned. The newly scanned barcode can be retrieved from BarcodeCaptureSession.newlyRecognizedBarcode.
Sometimes, after receiving this callback, you may want to pause scanning or to stop scanning completely.
To pause scanning, but keep the camera (frame source) running, just disable the barcode capture.
To stop scanning, you will need to both disable the capture mode and stop the frame source.
While it’s possible to only stop the camera and keep the capture mode enabled, this may lead to additional scan events being delivered, which is typically not desired. The following lines of code show how to disable the capture mode and stop the frame source as well:
// no more didScan callbacks will be invoked after this call. await captureMode.setEnabled(false); // asynchronously turn off the camera as quickly as possible. await captureMode.context.frameSource.switchToDesiredState(SDCCore.FrameSourceState.Off);
- didUpdateSession(barcodeCapture, session)
didUpdateSession?: (barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession) =>
void
Added in version 6.13.0
Invoked after a frame has been processed by barcode capture and the session has been updated. In contrast to didScan(), this method is invoked, regardless whether a code was scanned or not. If codes were recognized in this frame, this method is invoked after didScan().
See the documentation in didScan() for information on how to properly stop recognition of barcodes.
Barcode Capture Advanced Listener
Defined under the namespace Scandit.Datacapture.Barcode