ScannerSettings
The ScannerSettings object defines all properties of Web Barcode SDK
Syntax
var ScannerSettings = { scanner: { frameTimeout: 100, barcodeTimeout: 1000, drawTimeout: 500, beep: true, light: false, beepData: "https://mysite.com/beep.mp3", barcodeAtPoint: false, scanningRect: {left:0, top:0, width:0, height:0}, outputDebug: true, }, viewport: { id: 'datasymbol-barcode-viewport', width: 640, height: 480, }, camera: { id: null, label: null, facingMode: 'user',//environment resx: 640, resy: 480, }, barcode: { barcodeTypes: ['Code128', 'Code39', 'EAN13', 'UPCA', 'DataMatrix', 'QRCode'], totalBarcodes: 1, CollectBarcodes: false, CollectBarcodesTime: 5000, //... all properies from setProperty WebAssembly method. }, };
ScannerSettings.scanner
- frameTimeout - pause (ms, default 100) between decoding of frames
- barcodeTimeout - pause (ms, default 1000) after successfully decoded barcode, allows to avoid repeated decoding of the same barcode
- drawTimeout - pause (ms, default 500) during which the barcode is rendered in preview
- beep - boolean (default true) defines play or not beep sound after successfully decoded barcode
- light - boolean (default false) defines turn on or not the device flashlight
now this feature is supported only by Chrome browser- beepData - URL for beep sound, if undefined SDK will play default one
- barcodeAtPoint - boolean (default false) if true you can determine only single barcode at the frame center
- scanningRect - the decoding area, all nulls means the whole frame
- outputDebug - outputs debug information in browser console
ScannerSettings.viewport
- id - within the HTML element with given ID, all necessary elements of the barcode reader are created
- width - the width of the HTML element video that will make a preview from the camera, if the null or undefined preview occupies the entire parental element. If the "width" is specified, you may not set the "height" parameter, in this case, the height will be proportional to the size of the frame.
- height - same as width
ScannerSettings.camera
- id - specifies the video device ID that you want to use (see getVideoDevices method), if null or undefined, the device will be used by default
- label - name of video device, really you do not need to pass it
- facingMode - this parameter can be used for mobile devices instead of the video device ID. Please, use string 'user' or 'environment'.
- resx - required X resolution of video frame, if the camera does not support such a resolution, the nearest possible will be used. Do not use (without the need) large frame resolution, because this could significantly encrease the frame processing time.
- resy - same as resx
ScannerSettings.barcode
- barcodeTypes - array of strings defines barcode, see Barcode Types
- CollectBarcodes - If this property is "true", the barcode scanner will search for all barcodes during the "CollectBarcodesTime" ms. If a barcode has been previously decoded, it will be marked as previouslyDecoded.
- ... other - see setProperty