Dev Center
Table of contents

This page is applicable to version 8.2.3

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.

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.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.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version(10.0.21)
    • Version 10.x
      • Version 10.0.20
    • Version 9.x
      • Version 9.6.40
      • Version 9.6.33
      • Version 9.6.32
      • Version 9.6.31
      • Version 9.6.30
      • Version 9.6.21
      • Version 9.6.20
      • Version 9.6.11
      • Version 9.6.10
      • Version 9.6.2
      • Version 9.6.1
      • Version 9.6.0
      • Version 9.3.1
      • Version 9.3.0
      • Version 9.2.13
      • Version 9.2.12
      • Version 9.2.11
      • Version 9.0.2
      • Version 9.0.1
      • Version 9.0.0
    • Version 8.x
      • Version 8.8.7
      • Version 8.8.5
      • Version 8.8.3
      • Version 8.8.0
      • Version 8.6.3
      • Version 8.6.0
      • Version 8.4.0
      • Version 8.2.5
      • Version 8.2.3
      • Version 8.2.1
      • Version 8.2.0
      • Version 8.1.3
      • Version 8.1.2
      • Version 8.1.0
      • Version 8.0.0
    • Version 7.x
      • Version 7.6.0
      • Version 7.5.0
    Change +