更新时间:2024-08-22 GMT+08:00
openCamera(打开摄像头)
接口描述
打开本端摄像头。
注意事项
已经建立与OpenEye的WebSocket连接。
方法定义
OpenEyeCall.prototype.openCamera = function(callId, callbacks)
参数描述
|
参数名 |
类型 |
可选/必选 |
描述 |
|---|---|---|---|
|
callId |
Number |
必选 |
当前通话的callID,在没有进行中的通话时则须设置为-1。 |
|
callbacks |
可选 |
回调方法。 |
回调方法的入参示例:
{
"description" : "tsdk_control_camera",
"result" : 0,
"rsp" : 67759
}
使用示例
function switchCameraMode() {
var ischecked = document.getElementById("camera-control-toggle-button").checked;
if (tupCurrentCallId == "") {
tupCurrentCallId = -1;
}
if (ischecked) {
console.info("switchCameraMode ischecked true.CallId is:"+tupCurrentCallId);
this.global_openEye_SDK.openEyeCall.openCamera(tupCurrentCallId, {
response: cameraModeResponse});
} else {
console.info("switchCameraMode ischecked false.CallId is:"+tupCurrentCallId);
this.global_openEye_SDK.openEyeCall.closeCamera(tupCurrentCallId, {
response: cameraModeResponse});
}
}
function cameraModeResponse(data) {
console.info(data);
if (data.result == 0) {
console.info("controlVideo Success.");
} else {
console.error("controlVideo failed.");
}
}
父主题: 设备管理