dynamsoft.dcsEnv.init()

Description

Initializes Dynamsoft camera object.

Syntax

dynamsoft.dcsEnv.init(videoViewerContainer, imageViewerContainer, onSuccess, onFailure);

Parameters

<string> videoViewerContainer: The id of video container.
<string> imageViewerContainer: The id of image container.
<function> onSuccess(string videoViewerContainer, string imageViewerContainer): The success callback function.
<function> onFailure(int errorCode, string errorString): The failure callback function.

Return value

void

Remarks

If Dynamsoft camera object is initialized successfully, you can call dynamsoft.dcsEnv.getObject() to get the Object in the onSuccess function.
If Dynamsoft camera object is not initialized successfully, please check error code and error string in the onFailure function.

Example


var DCSObject;

dynamsoft.dcsEnv.init("DCSVideoViewerContainer", "DCSImageViewerContainer", onSuccess, onFailure); //DCSVideoViewerContainer and DCSImageViewerContainer are the container ids for video viewer and image viewer.

function onSuccess (videoViewerContainer, imageViewerContainer) {
    DCSObject = dynamsoft.dcsEnv.getObject(videoViewerContainer);
}

function onFailure (errorCode, errorString) {
    console.log (errorCode + errorString);
}