Updated on 2023-10-12 GMT+08:00

Enabling the Sharing Function

Interface Description

This interface is invoked to enable the sharing function.

Notes

Prerequisites: The WebSocket connection with the OpenEyeCall has been established.

Method Definition

OpenEyeCall.prototype.shareControl = function(value, callbacks)

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

value

bool

Mandatory

Whether to enable the sharing function.

callbacks

Callback

Mandatory

Callback method.

Table 2 Callback

Parameter

Type

Mandatory/Optional

Description

response

function

Mandatory

For details about the input parameters of the callback method, see Table 3.

Table 3 Input parameters of the callback method

Parameter

Type

Description

description

String

Description of the current request.

result

Number

Configuration result. The value 0 indicates success and other values indicate failure.

rsp

Number

Internal message ID.

The following is an example of input parameters of the callback method:

{
   "description" : "tsdk_share_evt_stopsharewindow",
   "result" : 0,
   "rsp" : 67760
}

Examples

function switchShare() {
 var ischecked = document.getElementById("share-control-toggle-button").checked;
 if (ischecked) {
  console.info("switchShare ischecked true.");
  shareSwitch = true;
  document.getElementById("shareControlDiv").style.visibility = "visible";
  this.global_openEye_SDK.openEyeCall.shareControl(shareSwitch, { response: switchShareRespone })
 } else {
  console.info("switchShare ischecked false.");
  shareSwitch = false;
  document.getElementById("shareControlDiv").style.visibility = "hidden";
  this.global_openEye_SDK.openEyeCall.shareControl(shareSwitch, { response: switchShareRespone })
 }
}

function switchShareRespone(data){
 console.log(data);
 if (data.result == 0) {
        console.info("switchShare Success");
    } else {
        console.error("switchShare failed");
        console.error(data);
    }
}