更新时间:2024-03-01 GMT+08:00
分享

开始录屏与结束录屏(定时返回base64编码)

接口描述

视频通话过程中开始或结束录制一段对方画面的视频,并返回base64编码,可实现定时录制。

注意事项

前置条件:已经建立与OpenEyeCall的WebSocket连接并处于视频通话中。

方法定义

OpenEyeCall.prototype.videoCatchBase64= function(operation, time, callbacks)

参数描述

表1 参数说明

参数名

类型

可选/必选

描述

operation

int

必选

进行的操作类型,0为开始录屏(base64编码),1为停止录屏(base64编码)

time

int

必选

操作类型为开始录屏时,传入定时录屏时间,最大不超过10秒,操作类型为结束录屏时传入0

callbacks

Callback

必选

回调方法。

表2 Callback

参数名

类型

可选/必选

描述

response

function

必选

回调方法。

表3 回调方法的入参

参数名

类型

描述

description

String

当前请求描述。

base64

String

视频的base64编码,录屏成功时返回

result

Number

设置结果。0表示成功,1表示失败,录屏失败时返回。

rsp

Number

内部消息编号。

回调方法的入参示例:

{
   "description" : "OECatchVideo",
   "result" : 1,
   "rsp" : 67762
}

{
   "description" : "OECatchVideo",
   "base64" : "xxx",
   "rsp" : 67762
}

使用示例

function catchVideoBase64(operation){
	var time =  document.getElementById('CatchVideoTime').value;
	if (time != "" || operation == 3){
		this.global_openEye_SDK.openEyeCall.videoCatchBase64(operation, parseInt(time), { response: startVideoCatchResponse })
	}
}

function startVideoCatchResponse(data){
	console.log(data);
	if (data.result == 0) {
        console.info("VideoCatch Success");
    } else {
        console.error("VideoCatch failed");
        console.error(data);
    }
}
分享:

    相关文档

    相关产品