Thanks for downloading Dynamsoft Barcode Reader Package!
Your download will start shortly. If your download does not begin, click here to retry.
BarcodeScanner
Capture SettingsMethod | Description |
---|---|
getCapabilities |
Get the camera capabilities. |
getResolution |
Get current video resolution. |
setResolution |
Set current video resolution. |
getScanSettings |
Get current scan settings. |
updateScanSettings |
Modify and update scan settings. |
getVideoSettings |
Get current video settings. |
updateVideoSettings |
Modify and update video settings. |
setColorTemperature |
Adjust the video colour temperature. |
setExposureCompensation |
Adjust the video exposure level. |
setFrameRate |
Adjust the video frame rate. |
setZoom |
Adjust the video zoom ratio. |
turnOffTorch |
Turn off the torch/flashlight. |
turnOnTorch |
Turn on the torch/flashlight. |
Get the camera capabilities. Chrome only. Camera must be open before use.
getCapabilities() returns MediaTrackCapabilities
MediaTrackCapabilities
> scanner.getCapabilities()
< {
"aspectRatio":{"max":3840,"min":0.000462962962962963},
"colorTemperature": {max: 7000, min: 2850, step: 50},
"deviceId":"1e...3af7",
"exposureCompensation": {max: 2.0000040531158447, min: -2.0000040531158447, step: 0.16666699945926666},
"exposureMode":["continuous","manual"],
"facingMode":["environment"],
"focusMode":["continuous","single-shot","manual"],
"frameRate":{"max":30,"min":0},
"groupId":"71...a935",
"height":{"max":2160,"min":1},
"resizeMode":["none","crop-and-scale"],
"torch":true,
"whiteBalanceMode":["continuous","manual"],
"width":{"max":3840,"min":1},
"zoom":{max: 606, min: 100, step: 2}
}
Check out the following APIs to modify your device capabilities (if supported).
setColorTemperature
- Adjust the video colour temperature.setExposureCompensation
- Adjust the video exposure level.setFrameRate
- Adjust the video frame rate.setZoom
- Adjust the video zoom ratio.turnOffTorch
- Turn off the torch/flashlight.turnOnTorch
-Turn on the torch/flashlight.Get current video resolution.
getResolution() returns number[]
number[]
let rsl = await scanner.getResolution();
console.log(rsl.width + " x " + rsl.height);
Read barcodes from live camera
Set the camera resolution.
setResolution(width, height) returns Promise
width number
|
number[] |
height
number
Promise<ScannerPlayCallbackInfo>
Read barcodes from live camera
Get current scan settings of BarcodeScanner
and saves it into a struct.
getScanSettings() returns Promise
Promise<ScanSettings>
Read barcodes from live camera
Modify and update scan settings.
updateScanSettings(settings) returns Promise
settings
ScanSettings
Promise<void>
Read barcodes from live camera
Get current video settings of BarcodeScanner
and saves it into a struct.
getVideoSettings() returns MediaStreamConstraints
MediaStreamConstraints
Read barcodes from live camera
Modify and update video settings.
updateVideoSettings(MediaStreamConstraints) returns Promise
MediaStreamConstraints
any
Promise<ScannerPlayCallbackInfo | void>
await scanner.updateVideoSettings({
video: { width: { ideal: 1280 },
height: { ideal: 720 },
facingMode: { ideal: 'environment' }
}
});
Read barcodes from live camera
Adjust the video colour temperature. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
setColorTemperature(value) returns Promise
value
number
Promise<void>
Read barcodes from live camera
Adjust the video exposure level. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
setExposureCompensation(value) returns Promise
value
number
Promise<void>
Read barcodes from live camera
Adjust the video frame rate. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
setFrameRate(value) returns Promise
value
number
Promise<void>
Read barcodes from live camera
Adjust the video zoom ratio. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
setZoom(value) returns Promise
value
number
Promise<void>
Read barcodes from live camera
Turn off the torch/flashlight. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
turnOffTorch() returns Promise
Promise<void>
Read barcodes from live camera
Turn on the torch/flashlight. Chrome only. Camera must be open before use. Check if this capability is supported by the camera using getCapabilities
.
turnOnTorch() returns Promise
Promise<void>
latest version