JavaScript API Reference
Methods and Properties
Initialization
| 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
| 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
| 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
| 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
| Name | Description |
|---|---|
| getVersion() | Returns the version of the library. |
| detectEnvironment() | Returns a report on the current running environments. |