Spark Capture#

Defined under the namespace Scandit.Datacapture.Barcode.Spark

Note

The Spark Capture API is still in beta and may change in future versions of the Scandit Data Capture SDK.

SparkCapture#
class SparkCapture : DataCaptureMode

Added in version 6.9.0

Capture mode that implements spark capture.

This capture mode uses the barcode scanning capability. It cannot be used together with other capture modes that require the same capabilities, e.g. BarcodeCapture.

forContext(context, settings)#
static forContext(context: DataCaptureContext | null,
        settings: SparkCaptureSettings): SparkCapture

Added in version 6.9.0

Construct a new spark capture mode with the provided context and settings. When the context is not null, the capture mode is automatically added to the context.

isEnabled#
isEnabled: boolean

Added in version 6.9.0

Implemented from DataCaptureMode. See DataCaptureMode.isEnabled.

applySettings(settings)#
applySettings(settings: SparkCaptureSettings): Promise<void>

Added in version 6.9.0

Asynchronously applies the new settings to the barcode scanner. If the scanner is currently running, the task will complete when the next frame is processed, and will use the new settings for that frame. If the scanner is currently not running, the task will complete as soon as the settings have been stored and won’t wait until the next frame is going to be processed.

context#
get context(): DataCaptureContext | null

Added in version 6.9.0

Implemented from DataCaptureMode. See DataCaptureMode.context.

addListener(listener)#
addListener(listener: SparkCaptureListener): void

Added in version 6.9.0

Adds the listener to this spark capture instance.

In case the same listener is already observing this instance, calling this method will not add the listener again.

removeListener(listener)#
removeListener(listener: SparkCaptureListener): void

Added in version 6.9.0

Removes a previously added listener from this spark capture instance.

In case the listener is not currently observing this instance, calling this method has no effect.

feedback#
feedback: SparkCaptureFeedback

Added in version 6.9.0

Instance of SparkCaptureFeedback that is used by spark capture to notify users about a successful scan of a barcode.

To change the feedback emitted, the SparkCaptureFeedback can be modified as shown below, or a new one can be assigned.

const sparkCapture = ...;
sparkCapture.feedback.success = new Scandit.Feedback(Scandit.Vibration.impactHapticFeedback, Sound.defaultSound);