Resource Base
Table of contents

JavaScript API Reference

Methods and Properties

Initialization

API Name Description
createInstance() Creates a CameraEnhancer instance.
defaultUIElementURL Returns or sets the URL of the .html file that defines the default UI Element.
getUIElement() Returns the HTML element that is used by the CameraEnhancer instance.
setUIElement() Specifies an HTML element for the CameraEnhancer instance to use as its UI element.

Camera Control

API Name Description
getAllCameras() Returns infomation of all available cameras on the device.
selectCamera() Chooses a camera as the video source.
getSelectedCamera() Returns information about the selected / current camera.
open() Turn on the camera to start streaming live video.
close() Stops video streaming and releases the camera.
isOpen() Returns whether the selected camera is turned on / occupied.
onPlayed Defines a callback which is triggered when the video streaming first starts or restarts when its source (camera) or resolution changes.
pause() Pauses video streaming without releasing the camera.
resume() Resumes video streaming.
setResolution() Sets the resolution of the current video input.
getResolution() Returns the resolution of the current video input.

Advanced Camera Control

API Name Description
setFrameRate() Adjusts the frame rate.
getFrameRate() Returns the real-time frame rate.
turnOnTorch() Turns on the torch/flashlight.
turnOffTorch() Turns off the torch/flashlight.
setZoom() Sets the zoom level of the video.
getCapabilities() Inspects and returns the capabilities of the selected camera.
getCameraSettings() Returns the current values for each constrainable property of the selected camera.
setColorTemperature() Adjusts the color temperature of the selected camera.
setExposureCompensation() Sets the exposure compensation index of the selected camera.

Frame Acquisition

API Name Description
getFrame() Returns a DCEFrame object which contains the image data of the latest frame from the video input.
singleFrameMode Returns or sets whether to enable the singe-frame mode.
onSingleFrameAcquired This event is triggered when a new frame / image is acquired under the single-frame mode.

Auxiliary APIs

API Name Description
getVersion() Returns the version of the library.
detectEnvironment() Returns a report on the current running environments.

Interfaces

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

version 2.0.3

  • Latest version
  • Version 4.x
    • Version 4.0.1(latest)
    • Version 4.0.0
  • Version 3.x
    • Version 3.3.10
    • Version 3.3.9
    • Version 3.3.8
    • Version 3.3.7
    • Version 3.3.6
    • Version 3.3.5
    • Version 3.3.4
    • Version 3.3.3
    • Version 3.3.2
    • Version 3.3.1
    • Version 3.3.0
    • Version 3.2.0
    • Version 3.1.0
    • Version 3.0.1
    • Version 3.0.0
  • Version 2.x
    • Version 2.3.5
    • Version 2.3.2
    • Version 2.3.1
    • Version 2.3.0
    • Version 2.1.4
    • Version 2.1.3
    • Version 2.1.0
    • Version 2.0.0
Change +