API_LOGIN

This JavaScript API is deprecated since version 1.55.

Users has been removed from the IceViewer HTML5 from version 1.55.

This function attempts to sign in to IceViewer HTML5 with the specified user with the specified password.

API function name: api_login(username, password)
Parameters:

username <string> [required]

password <string> [required]

Return Type:

Promise

PromiseResult will be true, if the login was successful, otherwise false.

Programmer notes:
Code Example:

<div class="actions">

<div>

<div id="login">Login (Guest)</div>

<div id="logout">Logout</div>

</div>

<div>

<iframe id="IceViewer" src="http://192.168.0.44:808/Default.cshtml"></iframe>

</div>

</div>

<script>

var iframeID = "IceViewer"; // IFRAME ID

$("#login").click(function () {

let success = document.getElementById(iframeID).contentWindow.api_login("Guest", "QwE"); // built-in user login

console.log(success); // writing Promise to the console

});

$("#logout").click(function () {

let success = document.getElementById(iframeID).contentWindow.api_logout();

console.log(success); // writing Promise to the console

});

</script>