MENU
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

JavaScript API Reference - BarcodeScanner Accessors

Accessors Description
defaultUIElementURL Get or set the default scanner UI.
singleFrameMode If set to true, single video frames will be used instead of a continuous video stream.
soundOnSuccessfulRead Get or set the sound to play when a barcode is read successfully.

Inherited Accessors from BarcodeReader

Accessors Description
engineResourcePath Get or set the engine (WASM) location.
productKeys Get or set the Dynamsoft Barcode Reader SDK product keys.
version Get current version.
licenseServer Gets or sets the URL of the license tracking server.
handshakeCode Gets or sets the handshake code.
sessionPassword Gets or sets the session password of the handshake code set in license tracking server.

defaultUIElementURL

Get or set the default scanner UI. The default scanner UI is defined in the file dist/dbr.scanner.html. Follow these steps to customize the UI.

defaultUIElementURL = 'url'

Property Value

url string

:+1: Tips and Tricks

  • Be sure to set defaultUIElementURL before you call createInstance.

singleFrameMode

Get or set the camera mode. If true, single video frames will be used instead of a continuous video stream. It’s especially useful for cameras that lack webcam access (lack of WebRTC support, e.g. Chrome on iOS).

singleFrameMode = bool;

Property Value

bool boolean

Sample

let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance();
scanner.singleFrameMode = true; // use singleFrameMode anyway
scanner.show();

:+1: Tips and Tricks

  • singleFrameMode is based on WebRTC support, not actual camera connection. In other words, if a browser supports WebRTC, it won’t be using singleFrameMode by default even when there is no camera attached.

  • By default, when the default UI is used, a camera icon will appear for the singleFrameMode which is defined by a SVG (className is dbrScanner-bg-camera). If you have customized the UI, you will have to provide your own UI implementation for this mode.

soundOnSuccessfulRead

Get or set the sound played when a barcode is read successfully.

soundOnSuccessfulRead = audio

Property Value

audio HTMLAudioElement

Sample

scanner.soundOnSuccessfulRead = new Audio("./pi.mp3");

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest Version
  • version 7.6
  • version 7.5
Change +
© 2003–2020 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support