The following interface describes the mwbScanner object.

The mwbScanner object is the main object which exposes the cmbWeb API.

⚡ A "scannerModuleLoaded" event is triggered once all the modules have loaded after loading the page. After this event the scanner is ready and exposed methods from the mwbScanner object can be invoked.

Listen for this event before using the API methods from the mwbScanner object. See the example event listener.

### Hierarchy

- mwbScanner

## Index

### Properties

- CONSTANTS

### Methods

- beep
- checkBrowserCompatibility
- closeScanner
- getActiveCamera
- getCameras
- getConstants
- getVersion
- loadSettings
- resizePartialScanner
- resumeScanning
- scanFrame
- scanImage
- setBlinkingLineVisible
- setCallback
- setCamera
- setIcon
- setScannerOverlayMode
- startScanning
- toggleFlash
- togglePauseResume
- toggleZoom

## Properties

### CONSTANTS

CONSTANTS: { MWB_GRAYSCALE_LENX_MIN: 10; MWB_GRAYSCALE_LENX_MAX: 5000; MWB_GRAYSCALE_LENY_MIN: 10; MWB_GRAYSCALE_LENY_MAX: 5000; MWB_CFG_CODE39_REQUIRE_CHECKSUM: 2; MWB_CFG_CODE39_DONT_REQUIRE_STOP: 4; MWB_CFG_CODE39_EXTENDED_MODE: 8; MWB_CFG_CODE39_CODE32_ENABLED: 16; MWB_CFG_CODE39_CODE32_PREFIX: 32; MWB_CFG_CODE93_EXTENDED_MODE: 8; MWB_CFG_CODE25_REQ_CHKSUM: 1; MWB_CFG_CODE25_REQ_CHKSUM_STANDARD: 2; MWB_CFG_CODE25_REQ_CHKSUM_INTERLEAVED: 4; MWB_CFG_CODE25_REQ_CHKSUM_IATA: 8; MWB_CFG_CODE25_REQ_CHKSUM_MATRIX: 16; MWB_CFG_CODE25_REQ_CHKSUM_COOP: 32; MWB_CFG_CODE25_REQ_CHKSUM_INVERTED: 64; MWB_CFG_CODE11_REQ_SINGLE_CHKSUM: 1; MWB_CFG_CODE11_REQ_DOUBLE_CHKSUM: 2; MWB_CFG_MSI_REQ_10_CHKSUM: 1; MWB_CFG_MSI_REQ_1010_CHKSUM: 2; MWB_CFG_MSI_REQ_11_IBM_CHKSUM: 4; MWB_CFG_MSI_REQ_11_NCR_CHKSUM: 8; MWB_CFG_MSI_REQ_1110_IBM_CHKSUM: 16; MWB_CFG_MSI_REQ_1110_NCR_CHKSUM: 32; MWB_CFG_CODABAR_INCLUDE_STARTSTOP: 1; MWB_CFG_DM_DPM_MODE: 2; MWB_CFG_TELEPEN_FORCE_NUMERIC: 1; MWB_CFG_EANUPC_DISABLE_ADDON: 1; MWB_CFG_EANUPC_DONT_EXPAND_UPCE: 2; MWB_PAR_ID_ECI_MODE: 8; MWB_PAR_ID_RESULT_PREFIX: 16; MWB_PAR_ID_VERIFY_LOCATION: 32; MWB_PAR_ID_SCAN_COLOR: 64; MWB_PAR_VALUE_ECI_DISABLED: 0; MWB_PAR_VALUE_ECI_ENABLED: 1; MWB_PAR_VALUE_RESULT_PREFIX_NEVER: 0; MWB_PAR_VALUE_RESULT_PREFIX_ALWAYS: 1; MWB_PAR_VALUE_RESULT_PREFIX_DEFAULT: 2; MWB_PAR_VALUE_VERIFY_LOCATION_OFF: 0; MWB_PAR_VALUE_VERIFY_LOCATION_ON: 1; MWB_PAR_VALUE_COLOR_NORMAL: 1; MWB_PAR_VALUE_COLOR_INVERTED: 2; MWB_PAR_VALUE_COLOR_BOTH: 4; MWB_CFG_GLOBAL_HORIZONTAL_SHARPENING: 1; MWB_CFG_GLOBAL_VERTICAL_SHARPENING: 2; MWB_CFG_GLOBAL_SHARPENING: 3; MWB_CFG_GLOBAL_ROTATE90: 4; MWB_CFG_GLOBAL_ROTATE180: 8; MWB_CFG_GLOBAL_CALCULATE_1D_LOCATION: 16; MWB_CFG_GLOBAL_VERIFY_1D_LOCATION: 32; MWB_CFG_GLOBAL_USE_CENTRIC_SCANNING: 64; MWB_CFG_GLOBAL_DISABLE_PREPROCESSING: 128; MWB_CFG_GLOBAL_ENABLE_MULTI: 256; MWB_CFG_GLOBAL_SCANLINESx2: 512; MWB_CFG_GLOBAL_SCANLINESx4: 1024; MWB_CFG_GLOBAL_SCANLINESx8: 2048; MWB_CODE_MASK_NONE: 0; MWB_CODE_MASK_QR: 1; MWB_CODE_MASK_DM: 2; MWB_CODE_MASK_RSS: 4; MWB_CODE_MASK_39: 8; MWB_CODE_MASK_EANUPC: 16; MWB_CODE_MASK_128: 32; MWB_CODE_MASK_PDF: 64; MWB_CODE_MASK_AZTEC: 128; MWB_CODE_MASK_25: 256; MWB_CODE_MASK_93: 512; MWB_CODE_MASK_CODABAR: 1024; MWB_CODE_MASK_DOTCODE: 2048; MWB_CODE_MASK_11: 4096; MWB_CODE_MASK_MSI: 8192; MWB_CODE_MASK_MAXICODE: 16384; MWB_CODE_MASK_POSTAL: 32768; MWB_CODE_MASK_TELEPEN: 65536; MWB_CODE_MASK_ALL: 16777215; MWB_SUBC_MASK_RSS_14: 1; MWB_SUBC_MASK_RSS_14_STACK: 2; MWB_SUBC_MASK_RSS_LIM: 4; MWB_SUBC_MASK_RSS_EXP: 8; MWB_SUBC_MASK_QR_STANDARD: 1; MWB_SUBC_MASK_QR_MICRO: 2; MWB_SUBC_MASK_PDF_STANDARD: 1; MWB_SUBC_MASK_PDF_MICRO: 2; MWB_SUBC_MASK_C25_INTERLEAVED: 1; MWB_SUBC_MASK_C25_STANDARD: 2; MWB_SUBC_MASK_C25_ITF14: 4; MWB_SUBC_MASK_C25_IATA: 8; MWB_SUBC_MASK_C25_MATRIX: 16; MWB_SUBC_MASK_C25_COOP: 32; MWB_SUBC_MASK_C25_INVERTED: 64; MWB_SUBC_MASK_POSTAL_POSTNET: 1; MWB_SUBC_MASK_POSTAL_PLANET: 2; MWB_SUBC_MASK_POSTAL_IM: 4; MWB_SUBC_MASK_POSTAL_ROYAL: 8; MWB_SUBC_MASK_POSTAL_AUSTRALIAN: 16; MWB_SUBC_MASK_EANUPC_EAN_13: 1; MWB_SUBC_MASK_EANUPC_EAN_8: 2; MWB_SUBC_MASK_EANUPC_UPC_A: 4; MWB_SUBC_MASK_EANUPC_UPC_E: 8; MWB_SUBC_MASK_EANUPC_UPC_E1: 16; MWB_SCANDIRECTION_HORIZONTAL: 1; MWB_SCANDIRECTION_VERTICAL: 2; MWB_SCANDIRECTION_OMNI: 4; MWB_SCANDIRECTION_AUTODETECT: 8; MWB_SCANDIRECTION_CUSTOM: 16; FOUND_NONE: 0; FOUND_DM: 1; FOUND_39: 2; FOUND_RSS_14: 3; FOUND_RSS_14_STACK: 4; FOUND_RSS_LIM: 5; FOUND_RSS_EXP: 6; FOUND_EAN_13: 7; FOUND_EAN_8: 8; FOUND_UPC_A: 9; FOUND_UPC_E: 10; FOUND_128: 11; FOUND_PDF: 12; FOUND_QR: 13; FOUND_AZTEC: 14; FOUND_25_INTERLEAVED: 15; FOUND_25_STANDARD: 16; FOUND_93: 17; FOUND_CODABAR: 18; FOUND_DOTCODE: 19; FOUND_128_GS1: 20; FOUND_ITF14: 21; FOUND_11: 22; FOUND_MSI: 23; FOUND_25_IATA: 24; FOUND_25_MATRIX: 25; FOUND_25_COOP: 26; FOUND_25_INVERTED: 27; FOUND_QR_MICRO: 28; FOUND_MAXICODE: 29; FOUND_POSTNET: 30; FOUND_PLANET: 31; FOUND_IMB: 32; FOUND_ROYALMAIL: 33; FOUND_MICRO_PDF: 34; FOUND_32: 35; FOUND_AUSTRALIAN: 36; FOUND_TELEPEN: 37; CamRes_SD: 0; CamRes_HD: 1; CamRes_FHD: 2; CAMERA_SWITCHER_INIT_ON_START: 1; CAMERA_SWITCHER_USE_ON_START: 3; CAMERA_SWITCHER_USE_BEST_CAMERA: 4; OverlayModeNone: 0; OverlayModeMW: 1; OverlayModeImage: 2; MIRROR_NONE: 0; MIRROR_FRONTCAM: 1; MIRROR_ALWAYS: 2; PM_NONE: 0; PM_PAUSE: 1; PM_STOP_BLINKING: 2; MWP_PARSER_MASK_NONE: 0; MWP_PARSER_MASK_GS1: 1; MWP_PARSER_MASK_IUID: 2; MWP_PARSER_MASK_ISBT: 4; MWP_PARSER_MASK_AAMVA: 8; MWP_PARSER_MASK_HIBC: 16; MWP_PARSER_MASK_SCM: 32; MWP_PARSER_MASK_AUTO: 255 }

#### Type declaration

- ##### MWB_GRAYSCALE_LENX_MIN: 10

  Grayscale image min width

- ##### MWB_GRAYSCALE_LENX_MAX: 5000

  Grayscale image max width

- ##### MWB_GRAYSCALE_LENY_MIN: 10

  Grayscale image min height

- ##### MWB_GRAYSCALE_LENY_MAX: 5000

  Grayscale image max width

  ##### Code39 | Code93 | Code25 symbology flags:

- ##### MWB_CFG_CODE39_REQUIRE_CHECKSUM: 2

  Code39 symbology flags value: require checksum check

- ##### MWB_CFG_CODE39_DONT_REQUIRE_STOP: 4

  Code39 symbology flags value: don't require stop symbol - can lead to false results

- ##### MWB_CFG_CODE39_EXTENDED_MODE: 8

  Code39 symbology flags value: decode full ASCII

- ##### MWB_CFG_CODE39_CODE32_ENABLED: 16

  Code39 symbology flags value: Try decoding result to CODE32. if failed, Code39 will return

- ##### MWB_CFG_CODE39_CODE32_PREFIX: 32

  Code39 symbology flags value: ADD 'A' prefix to Code32 result

- ##### MWB_CFG_CODE93_EXTENDED_MODE: 8

  Code93 symbology flags value: decode full ASCII

- ##### MWB_CFG_CODE25_REQ_CHKSUM: 1

  Code25 symbology flags value: require checksum check

  > NOTE: MWB_CFG_CODE25_REQ_CHKSUM is deprecated and shouldn't be used in combination with other checksum flags

- ##### MWB_CFG_CODE25_REQ_CHKSUM_STANDARD: 2

- ##### MWB_CFG_CODE25_REQ_CHKSUM_INTERLEAVED: 4

- ##### MWB_CFG_CODE25_REQ_CHKSUM_IATA: 8

- ##### MWB_CFG_CODE25_REQ_CHKSUM_MATRIX: 16

- ##### MWB_CFG_CODE25_REQ_CHKSUM_COOP: 32

- ##### MWB_CFG_CODE25_REQ_CHKSUM_INVERTED: 64

  ##### Code11 symbology flags value: require checksum check

- ##### MWB_CFG_CODE11_REQ_SINGLE_CHKSUM: 1

  Requires single checksum. Set by default.

- ##### MWB_CFG_CODE11_REQ_DOUBLE_CHKSUM: 2

  Requires double checksum.

  ##### MSI Plessey symbology flags value: require checksum check

- ##### MWB_CFG_MSI_REQ_10_CHKSUM: 1

  Use mod 10 checksum. Set by default.

- ##### MWB_CFG_MSI_REQ_1010_CHKSUM: 2

  Use mod 10 mod 10 checksum.

- ##### MWB_CFG_MSI_REQ_11_IBM_CHKSUM: 4

  Use mod 11 checksum (IBM algorithm).

- ##### MWB_CFG_MSI_REQ_11_NCR_CHKSUM: 8

  Use mod 11 checksum (NCR algorithm).

- ##### MWB_CFG_MSI_REQ_1110_IBM_CHKSUM: 16

  Use mod 11 mod 10 checksum (IBM algorithm).

- ##### MWB_CFG_MSI_REQ_1110_NCR_CHKSUM: 32

  Use mod 11 mod 10 checksum (NCR algorithm)

  ##### Codabar | DataMatrix | Telepen symbology flags:

- ##### MWB_CFG_CODABAR_INCLUDE_STARTSTOP: 1

  Codabar symbology flags value: include start/stop symbols in result

- ##### MWB_CFG_DM_DPM_MODE: 2

  Datamatrix symbology flags value: enable DPM mode

- ##### MWB_CFG_TELEPEN_FORCE_NUMERIC: 1

  Telepen symbology flags

  ##### UPC/EAN symbology disable addons detection:

- ##### MWB_CFG_EANUPC_DISABLE_ADDON: 1

- ##### MWB_CFG_EANUPC_DONT_EXPAND_UPCE: 2

  ##### Barcode symbology param types:

- ##### MWB_PAR_ID_ECI_MODE: 8

- ##### MWB_PAR_ID_RESULT_PREFIX: 16

- ##### MWB_PAR_ID_VERIFY_LOCATION: 32

- ##### MWB_PAR_ID_SCAN_COLOR: 64

  Scan color: working for Datamatrix currently

  ##### Barcode param values:

- ##### MWB_PAR_VALUE_ECI_DISABLED: 0

  Default for ECI (ECI is DM only)

- ##### MWB_PAR_VALUE_ECI_ENABLED: 1

- ##### MWB_PAR_VALUE_RESULT_PREFIX_NEVER: 0

  Default for result prefix (all symbologies except DataBar / RSS)

- ##### MWB_PAR_VALUE_RESULT_PREFIX_ALWAYS: 1

- ##### MWB_PAR_VALUE_RESULT_PREFIX_DEFAULT: 2

  Default for result prefix for DataBar / RSS only

- ##### MWB_PAR_VALUE_VERIFY_LOCATION_OFF: 0

- ##### MWB_PAR_VALUE_VERIFY_LOCATION_ON: 1

- ##### MWB_PAR_VALUE_COLOR_NORMAL: 1

- ##### MWB_PAR_VALUE_COLOR_INVERTED: 2

- ##### MWB_PAR_VALUE_COLOR_BOTH: 4

  Default for color (all symbologies)

  ##### Global decoder flags value: apply sharpening on input image

- ##### MWB_CFG_GLOBAL_HORIZONTAL_SHARPENING: 1

- ##### MWB_CFG_GLOBAL_VERTICAL_SHARPENING: 2

- ##### MWB_CFG_GLOBAL_SHARPENING: 3

  ##### Global decoder flags value: apply rotation on input image

- ##### MWB_CFG_GLOBAL_ROTATE90: 4

- ##### MWB_CFG_GLOBAL_ROTATE180: 8

  ##### Global decoder flags:

- ##### MWB_CFG_GLOBAL_CALCULATE_1D_LOCATION: 16

  Global decoder flags value: calculate location for 1D barcodeTypes (Code128, Code93, Code39 supported)

- ##### MWB_CFG_GLOBAL_VERIFY_1D_LOCATION: 32

  Global decoder flags value: fail 1D decode if result is not confirmed by location expanding (Code128, Code93, Code39 supported)

- ##### MWB_CFG_GLOBAL_USE_CENTRIC_SCANNING: 64

  Global decoder flags value: fail decode if result is not touching the center of viewfinder (2D + Code128, Code93, Code39 supported)

  1D locaiton flags will be enabled automatically with this one

- ##### MWB_CFG_GLOBAL_DISABLE_PREPROCESSING: 128

  Global decoder flags value: disable some image pre-processing, suitable for devices with weak CPU

- ##### MWB_CFG_GLOBAL_ENABLE_MULTI: 256

  Global decoder flags value: Enable multiple barcode detection in single image

  ##### Global decoder flags value: multiple scan lines density

- ##### MWB_CFG_GLOBAL_SCANLINESx2: 512

- ##### MWB_CFG_GLOBAL_SCANLINESx4: 1024

- ##### MWB_CFG_GLOBAL_SCANLINESx8: 2048

  ##### Bit mask identifiers for supported symbology types:

- ##### MWB_CODE_MASK_NONE: 0

- ##### MWB_CODE_MASK_QR: 1

- ##### MWB_CODE_MASK_DM: 2

- ##### MWB_CODE_MASK_RSS: 4

  > NOTE: MWB_CODE_MASK_RSS is GS1 DataBar

- ##### MWB_CODE_MASK_39: 8

- ##### MWB_CODE_MASK_EANUPC: 16

- ##### MWB_CODE_MASK_128: 32

- ##### MWB_CODE_MASK_PDF: 64

- ##### MWB_CODE_MASK_AZTEC: 128

- ##### MWB_CODE_MASK_25: 256

- ##### MWB_CODE_MASK_93: 512

- ##### MWB_CODE_MASK_CODABAR: 1024

- ##### MWB_CODE_MASK_DOTCODE: 2048

- ##### MWB_CODE_MASK_11: 4096

- ##### MWB_CODE_MASK_MSI: 8192

- ##### MWB_CODE_MASK_MAXICODE: 16384

- ##### MWB_CODE_MASK_POSTAL: 32768

- ##### MWB_CODE_MASK_TELEPEN: 65536

- ##### MWB_CODE_MASK_ALL: 16777215

  ##### Bit mask identifiers for RSS symbology subtypes:

- ##### MWB_SUBC_MASK_RSS_14: 1

- ##### MWB_SUBC_MASK_RSS_14_STACK: 2

- ##### MWB_SUBC_MASK_RSS_LIM: 4

- ##### MWB_SUBC_MASK_RSS_EXP: 8

  ##### Bit mask identifiers for QR symbology subtypes:

- ##### MWB_SUBC_MASK_QR_STANDARD: 1

- ##### MWB_SUBC_MASK_QR_MICRO: 2

  ##### Bit mask identifiers for PDF symbology subtypes:

- ##### MWB_SUBC_MASK_PDF_STANDARD: 1

- ##### MWB_SUBC_MASK_PDF_MICRO: 2

  ##### Bit mask identifiers for Code 2 of 5 symbology subtypes:

- ##### MWB_SUBC_MASK_C25_INTERLEAVED: 1

- ##### MWB_SUBC_MASK_C25_STANDARD: 2

- ##### MWB_SUBC_MASK_C25_ITF14: 4

- ##### MWB_SUBC_MASK_C25_IATA: 8

- ##### MWB_SUBC_MASK_C25_MATRIX: 16

- ##### MWB_SUBC_MASK_C25_COOP: 32

- ##### MWB_SUBC_MASK_C25_INVERTED: 64

  ##### Bit mask identifiers for POSTAL symbology subtypes:

- ##### MWB_SUBC_MASK_POSTAL_POSTNET: 1

- ##### MWB_SUBC_MASK_POSTAL_PLANET: 2

- ##### MWB_SUBC_MASK_POSTAL_IM: 4

- ##### MWB_SUBC_MASK_POSTAL_ROYAL: 8

- ##### MWB_SUBC_MASK_POSTAL_AUSTRALIAN: 16

  ##### Bit mask identifiers for UPC/EAN symbology subtypes:

- ##### MWB_SUBC_MASK_EANUPC_EAN_13: 1

- ##### MWB_SUBC_MASK_EANUPC_EAN_8: 2

- ##### MWB_SUBC_MASK_EANUPC_UPC_A: 4

- ##### MWB_SUBC_MASK_EANUPC_UPC_E: 8

- ##### MWB_SUBC_MASK_EANUPC_UPC_E1: 16

  ##### Bit mask identifiers for 1D scanning direction:

- ##### MWB_SCANDIRECTION_HORIZONTAL: 1

- ##### MWB_SCANDIRECTION_VERTICAL: 2

- ##### MWB_SCANDIRECTION_OMNI: 4

- ##### MWB_SCANDIRECTION_AUTODETECT: 8

- ##### MWB_SCANDIRECTION_CUSTOM: 16

- ##### FOUND_NONE: 0

- ##### FOUND_DM: 1

- ##### FOUND_39: 2

- ##### FOUND_RSS_14: 3

- ##### FOUND_RSS_14_STACK: 4

- ##### FOUND_RSS_LIM: 5

- ##### FOUND_RSS_EXP: 6

- ##### FOUND_EAN_13: 7

- ##### FOUND_EAN_8: 8

- ##### FOUND_UPC_A: 9

- ##### FOUND_UPC_E: 10

- ##### FOUND_128: 11

- ##### FOUND_PDF: 12

- ##### FOUND_QR: 13

- ##### FOUND_AZTEC: 14

- ##### FOUND_25_INTERLEAVED: 15

- ##### FOUND_25_STANDARD: 16

- ##### FOUND_93: 17

- ##### FOUND_CODABAR: 18

- ##### FOUND_DOTCODE: 19

- ##### FOUND_128_GS1: 20

- ##### FOUND_ITF14: 21

- ##### FOUND_11: 22

- ##### FOUND_MSI: 23

- ##### FOUND_25_IATA: 24

- ##### FOUND_25_MATRIX: 25

- ##### FOUND_25_COOP: 26

- ##### FOUND_25_INVERTED: 27

- ##### FOUND_QR_MICRO: 28

- ##### FOUND_MAXICODE: 29

- ##### FOUND_POSTNET: 30

- ##### FOUND_PLANET: 31

- ##### FOUND_IMB: 32

- ##### FOUND_ROYALMAIL: 33

- ##### FOUND_MICRO_PDF: 34

- ##### FOUND_32: 35

- ##### FOUND_AUSTRALIAN: 36

- ##### FOUND_TELEPEN: 37

  ##### Camera scanning resolutions:

- ##### CamRes_SD: 0

  Standard definition 640x480 camera resolution.

- ##### CamRes_HD: 1

  High definition 1280x720 camera resolution.

- ##### CamRes_FHD: 2

  Full HD 1920x1080 camera resolution.

  ##### Camera switcher options:

- ##### CAMERA_SWITCHER_INIT_ON_START: 1

  > Note: this option has beed deprecated i.e. it has no effect as camera switcher initialization is always awaited.

  ⚠️ [Deprecated] The camera switcher initialization happens after a startScanning call, i.e. on creating a cameraPreview. The operation for listing all available cameras is async, thus it can be awaited which ensures the camera list is obtained first before proceeding to starting the camera and scanning, otherwise, it would be executed as asynchronous, where the camera and scanning will be started most likely before the camera list is obtained. This option will await the initialization, thus it will take longer until the camera and scanning is started.

- ##### CAMERA_SWITCHER_USE_ON_START: 3

  By default the MWBuseFrontCamera setting has priority at picking which camera (back or front) to use on the cameraPreview, and will continue to be the case until a specific camera is picked and switched to from the camera switcher UI. This option will use the first camera from the camera list on the start of the cameraPreview, thus the MWBuseFrontCamera setting would no longer have effect. Using CAMERA_SWITCHER_USE_ON_START also implies CAMERA_SWITCHER_INIT_ON_START.

- ##### CAMERA_SWITCHER_USE_BEST_CAMERA: 4

  ✨ [Experimental] Devices with multple back cameras may provide the multple back cameras separately rather than as one system, and the wide-angle camera which has no autofocus could be used by default. While there is no official indicator which camera has autofocus, based on observed common denominator in such cases, this option will try to order the multple found cameras such that the main camera which has autofocus will be listed first and used as default.

  ##### Overlay modes:

- ##### OverlayModeNone: 0

  No overlay is displayed.

- ##### OverlayModeMW: 1

  Use MW Dynamic Viewfinder with blinking lines.

- ##### OverlayModeImage: 2

  Show image on top of cameraPreview

  ##### Mirror modes:

- ##### MIRROR_NONE: 0

  No camera preview mirroring is done.

- ##### MIRROR_FRONTCAM: 1

  Camera preview mirroring is done only when using front cameras.

- ##### MIRROR_ALWAYS: 2

  Camera preview mirroring is always done.

  ##### Pause modes:

- ##### PM_NONE: 0

  Nothing happens.

- ##### PM_PAUSE: 1

  Blinking lines are replaced with a pause view.

- ##### PM_STOP_BLINKING: 2

  Blinking lines stop blinking.

  ##### Bit mask identifiers for supported parser types:

- ##### MWP_PARSER_MASK_NONE: 0

- ##### MWP_PARSER_MASK_GS1: 1

- ##### MWP_PARSER_MASK_IUID: 2

- ##### MWP_PARSER_MASK_ISBT: 4

- ##### MWP_PARSER_MASK_AAMVA: 8

- ##### MWP_PARSER_MASK_HIBC: 16

- ##### MWP_PARSER_MASK_SCM: 32

- ##### MWP_PARSER_MASK_AUTO: 255

## Methods

### beep

- beep(): void

- Play a beep sound (requires user input).

  - Required user input explanation

  The use of startScanning (initiated by user action such as the click of a button, once per session) must precede the use of this method.

  #### Returns void

### checkBrowserCompatibility

- checkBrowserCompatibility(checkDefaultCamera?: boolean): Promise<object>

- Check browser support for features.

  By default this method only checks synchronous features.

  Some of the features are obtained asynchronously. The check for those features can be enabled by passing their respective parameters.

  #### Parameters

  - ##### Optional checkDefaultCamera: boolean

    Check default camera properties and capabilities.

    > Note: Obtaining camera properties and capabilities requires camera start. This is an async operation and it takes some time to initialize the camera and obtain the result. If camera access permission isn't already granted, this will request user permission.

  #### Returns Promise<object>

  An object of features needed for cmbWeb and their browser support state.

  - MEDIA_DEVICES: boolean

  Support for mediaDevices and getUserMedia APIs.

  Starting a camera preview scanning session relies on mediaDevices and getUserMedia.
  If not available, live camera scanning with the startScanning method will not be possible.
  This can also happen if current context is not secure, see next feature.

  - SECURE_CONTEXT: boolean

  Current window is in a secure context.

  The mediaDevices and getUserMedia APIs are accessible only in a secure context.
  If not available, live camera scanning with the startScanning method will not be possible.
  Using the getCameras method will not be possible as well.

  - > 💡 Tip: Other scanning methods such as scanImage will still work.

  - SCREEN_ORIENTATION: boolean

  Support for screen.orientation property.

  If not available, window size will be used to determine orientation.

  - WEB_ASSEMBLY: boolean

  Support for WebAssembly.

  If not available, cmbWeb will not be able to run.

  - WEB_AUDIO: boolean

  Support for Web Audio API.

  AudioContext is used from the Web Audio API to provide the audio play support across
  all browsers and platforms for the beep method.

  If not available, HTMLAudioElement will be used as fallback, which may not provide audio
  play support across all browsers and platforms due to permission constraints.

  - CAMERA_FLASH: boolean

  Support for camera flash.

  This indicates that the browser supports the camera flash feature. The camera device
  has to have flash capability for it to actually be used. For example, a front camera may
  not always have flash capability.

  Camera flash is currently supported only by Chrome.

  - CAMERA_ZOOM: boolean

  Support for camera zoom.

  This indicates that the browser supports the camera zoom feature. The camera device
  has to have zoom capability for it to actually be used. For example, a USB camera may
  not always have zoom capability.

  Camera zoom is currently supported only by Chrome.

  - Optional DEFAULT_CAMERA: object
    A default camera device is the first camera picked by the browser in case of multiple cameras being present. This will typically be the default back camera on mobile devices.
    Any configuration changes, i.e. specifying front camera or setting / selecting a specific camera via setCamera or the camera switcher UI do not affect the default camera.
    Properties and capabilities of the default camera device:

    - LABEL: string
      Descriptive label of the camera.

    - ID: string
      Unique id of the camera.

    - FLASH: boolean
      The camera device has flash capability.

    - ZOOM: boolean
      The camera device has zoom capability.

    - ZOOM_VALUES: boolean
      Support for camera provided zoom level values.
      If not available, pre-defined values will be used for the zoom levels.

    - ZOOM_LEVELS: [min: number, mid: number, max: number]
      Used zoom levels.
      Camera provided zoom levels will be used if available, otherwise, pre-defined values of 100% (min i.e. no zoom), 250% (mid) and 400% (max) will be used.

### closeScanner

- closeScanner(): void

- Close a previously started scan from startScanning.

  ⚡ A "cameraPreviewClosed" event is triggered when the camera preview is removed from the document body or container element after calling the closeScanner method. See the example event listener.

  #### Returns void

### getActiveCamera

- getActiveCamera(): string

- #### Returns string

  - id     - Unique id of the camera

  Returns the ID of the currently used camera, empty string if no camera is used.

### getCameras

- getCameras(): Promise<[{ id: string; label: string }]>

- #### Returns Promise<[{ id: string; label: string }]>

  - id     - Unique id of the camera
  - label    - Descriptive label of the camera

  Get available cameras for this device.

### getConstants

- getConstants(): object

- Get the constants of the scanner so they can be used when calling configuration functions.

  #### Returns object

### getVersion

- getVersion(): object

- #### Returns object

  - cmbWebVersion    - cmbWeb version
  - decoderVersion    - decoding library version
  - fullVersion      - cmbWebVersion and decoderVersion

  Returns an object of cmbWebVersion, decoderVersion and fullVersion.

### loadSettings

- loadSettings(configSettings: [{ method: string; value: any[] }]): Promise<[{ method: string; value: any[] }]>

- Load the array of configuration settings. Returns a promise that resolves with the loaded settings.

  Should be called in the configuration stage.

  #### Parameters

  - ##### configSettings: [{ method: string; value: any[] }]

    - method   - Method name i.e. 'MWBmethodName'
    - value    - Array of method arg(s) specific to 'MWBmethodName'

  #### Returns Promise<[{ method: string; value: any[] }]>

### resizePartialScanner

- resizePartialScanner(x: number, y: number, width: number, height: number): void

- Resizes partial scanner cameraPreview dimensions.

  If a div element with "cmbweb-preview-container" id is used in the html page, the sdk will detect this and operate in 'container mode' (the cameraPreview will fill the container).

  The resizePartialScanner method has no effect in container mode.

  #### Parameters

  - ##### x: number

    X coordinate of left edge (percentage)

  - ##### y: number

    Y coordinate of top edge (percentage)

  - ##### width: number

    Rectangle witdh (x axis) (percentage)

  - ##### height: number

    Rectangle height (y axis) (percentage)

  #### Returns void

### resumeScanning

- resumeScanning(): void

- Resumes scanning after it was paused.

  Use this method if already using MWBcloseScannerOnDecode(false) to achieve continuous scanning.

  #### Returns void

### scanFrame

- scanFrame(imageData: string | ImageData, callback?: MyCallback): void

- Scan a single frame.

  #### Parameters

  - ##### imageData: string | ImageData

    Either an ImageData object or a dataURL image string to be scanned.

    Using ImageData is convenient and faster because data is already in desired format, the only requirement is that the data remains unchanged during the scan (i.e. until it's copied to memory).

    Using dataURL is slower and not recommended for live scanning scenarios. Because the actual data is represented in base64 in a respective encoding/compressing format (png, jpeg, etc.), it requires extra decoding steps to get the raw pixel format, which takes significant time.

  - ##### Optional callback: MyCallback

    Result callback (will get replaced by a default callback if it's missing)

  #### Returns void

### scanImage

- scanImage(imageURI: string, callback?: MyCallback): void

- Scan an image file.

  #### Parameters

  - ##### imageURI: string

    The path to the image file.

  - ##### Optional callback: MyCallback

    Result callback (will get replaced by a default callback if it's missing)

  #### Returns void

### setBlinkingLineVisible

- setBlinkingLineVisible(visible: boolean): void

- Set the visibility of the cameraPreview blinking lines.

  An API version of the MWBsetBlinkingLineVisible configuration method.

  #### Parameters

  - ##### visible: boolean

    Visible blinking lines. Default value is true.

  #### Returns void

### setCallback

- setCallback(callback: MyCallback): void

- Set a custom callback function that's called once the scan is performed. Should be called in the configuration stage.

  > Note: If the scanning method provides its own callback, the provided callback will be used.

  #### Parameters

  - ##### callback: MyCallback

    Result callback to set as a default callback.

  #### Returns void

### setCamera

- setCamera(id: string): void

- Set a specific camera to use for this device.

  > Note: Overrides the effect of the MWBuseFrontCamera setting.

  #### Parameters

  - ##### id: string

    Unique id of the camera (obtained from getCameras).

  #### Returns void

### setIcon

- setIcon(iconURI: string, allowCrossOrigin?: boolean): void

- Set the license image file. Should be called in the configuration stage.

  > Note: When setting just the image file name, the image file is expected to be in the same directory as the .html file which includes the .js file which calls the setIcon method (even when the .js file resides in a different directory). Relative paths work relative to the directory of the including .html file. Absolute paths work with respect to the root.

  > Note: Since v1.1.0 this method must be called. The licensing image can be an empty file (i.e. carries no license) but still must be used.

  #### Parameters

  - ##### iconURI: string

    The license image name (and path if different directory is used).

  - ##### Optional allowCrossOrigin: boolean

    Allows cross origin if set to true, otherwise if set to false or not used at all it keeps the default (no cross origin).

    Allowing cross origin would enable the option of using a license image that is hosted on another server i.e. originates from a domain other than the one the web app is hosted on, such as a CDN for example.

    > Note: The server hosting the licensing image also needs to be configured to allow CORS for it.

  #### Returns void

### setScannerOverlayMode

- setScannerOverlayMode(overlayMode: number): void

- An API version of the MWBsetOverlayMode configuration method.

  #### Parameters

  - ##### overlayMode: number

    The overlay mode of the cameraPreview overlay.

  #### Returns void

### startScanning

- startScanning(callback?: MyCallback, x?: number, y?: number, width?: number, height?: number): void

- Starts the scanner with different params.

  - Fullscreen scanner:

      mwbScanner.startScanning()
      mwbScanner.startScanning(callback)

  - Partial view scanner:

      mwbScanner.startScanning(x, y, width, height)
      mwbScanner.startScanning(callback, x, y, width, height)

  - Container element:

      <div id="cmbweb-preview-container" style="border:1px solid; position:fixed; top:25%; left:25%; width:50%; height:30%; background-color:gray;"></div>

  If a div element with "cmbweb-preview-container" id is used in the html page, the sdk will detect this and operate in 'container mode' (the cameraPreview will fill the container).

  The x,y,width,height args have no effect in container mode.

  ⚡ A "cameraReady" event is triggered when the camera is fully initialized after calling the startScanning method. After this event the cameraPreview is shown. See the example event listener.

  Calling the startScanning method involves camera access and requests user permissions if needed.

  Depending on device features and user permissions for camera access, any of the following camera-related errors could be returned in the result.errorDetails.name of the callback:

  - NotReadableError
  - ProtocolError
  - NotAllowedError
  - NotFoundError
  - AbortError
  - OverconstrainedError

  See result fields.

  #### Parameters

  - ##### Optional callback: MyCallback

    Result callback (will get replaced by a default callback if it's missing)

  - ##### Optional x: number

    Partial view left edge (percentage)

  - ##### Optional y: number

    Partial view top edge (percentage)

  - ##### Optional width: number

    Partial view witdh (percentage)

  - ##### Optional height: number

    Partial view height (percentage)

  #### Returns void

### toggleFlash

- toggleFlash(): void

- Toggles the flash feature (if present) of the camera.

  The toggle switches between on and off state.

  #### Returns void

### togglePauseResume

- togglePauseResume(): void

- Toggles between pause and resume of scanning.

  The camera stream will continue running (i.e. will be shown on the cameraPreview), but no frames will be scanned by the decoder during the paused state. This will significantly reduce CPU usage.

  #### Returns void

### toggleZoom

- toggleZoom(): void

- Toggles the zoom feature (if present) of the camera.

  Typically there are 3 zoom states that the toggle cycles through: no zoom, 50% zoom, 100% zoom.

  #### Returns void

Generated using TypeDoc