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

Starting and Stopping Screen Recording (Periodically Returning Base64 Codes)

Interface Description

This interface is invoked to start or stop recording the screen of the other party and return the Base64 code to implement scheduled recording.

Notes

Prerequisites: The WebSocket connection with the OpenEyeCall has been set up, and a video call is in progress.

Method Definition

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

Parameter Description

Table 1 Parameter description

Parameter

Type

Mandatory/Optional

Description

operation

int

Mandatory

Operation type. The value 0 indicates starting screen recording (encoded by Base64) and 1 indicates stopping screen recording (encoded by Base64).

time

int

Mandatory

When the operation type is 0, the value of this parameter is the scheduled screen recording duration, which cannot exceed 10 seconds. When the operation type is 1, the value of this parameter is 0.

callbacks

Callback

Mandatory

Callback method.

Table 2 Callback

Parameter

Type

Mandatory/Optional

Description

response

function

Mandatory

Callback method.

Table 3 Input parameters of the callback method

Parameter

Type

Description

description

String

Description of the current request.

base64

String

Base64 code of the video, which is returned when the screen recording is successful.

result

Number

Configuration result. The value 0 indicates success and 1 indicates failure (returned when screen recording fails).

rsp

Number

Internal message ID.

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

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

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

Examples

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);
    }
}