更新时间:2024-08-22 GMT+08:00
共享开关
接口描述
控制共享功能是否启用。
注意事项
前置条件:已经建立与OpenEyeCall的WebSocket连接。
方法定义
OpenEyeCall.prototype.shareControl = function(value, callbacks)
参数描述
参数名 | 类型 | 可选/必选 | 描述 |
|---|---|---|---|
value | bool | 必选 | 共享开关是否打开。 |
callbacks | 必选 | 回调方法。 |

回调方法的入参示例:
{
"description" : "tsdk_share_evt_stopsharewindow",
"result" : 0,
"rsp" : 67760
} 使用示例
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);
}
} 父主题:屏幕共享

