**Where should i set true to recording property . I created session api as like below. but recording value will always returning false.
Dont know where to configure for enabling recording as true in REST API.
Kindly help to resolve this issue.**
createSession(sessionId) {
return new Promise((resolve, reject) => {
var data = JSON.stringify({ customSessionId: sessionId,
"recording": true,
"mediaMode": "ROUTED",
"recordingMode": "ALWAYS",
"defaultOutputMode": "COMPOSED",
"defaultRecordingLayout": "BEST_FIT"});
axios
.post(OPENVIDU_SERVER_URL + '/api/sessions', data, {
headers: {
Authorization: 'Basic ' + btoa('OPENVIDUAPP:' + OPENVIDU_SERVER_SECRET),
'Content-Type': 'application/json',
},
})
.then((response) => {
console.log('CREATE SESION', response);
//alert(response.OPENVIDU_STREAMS_VIDEO_MAX_RECV_BANDWIDTH);
fetch(OPENVIDU_SERVER_URL + '/api/sessions/'+sessionId , {
method: 'GET',
headers: {
Authorization: 'Basic ' + btoa('OPENVIDUAPP:' + OPENVIDU_SERVER_SECRET),
'Content-Type': 'application/json',
}
})
.then(res => res.json())
.then(
(result) => {
console.log("GETSESS"+result.recording);//Always returning false
},
(error) => {
alert(error);
console.log(error);
}
);
resolve(response.data.id);
})
.catch((response) => {
var error = Object.assign({}, response);
if (error.response.status === 409) {
resolve(sessionId);
} else {
console.log(error);
console.warn(
'No connection to OpenVidu Server. This may be a certificate error at ' +
OPENVIDU_SERVER_URL,
);
if (
window.confirm(
'No connection to OpenVidu Server. This may be a certificate error at "' +
OPENVIDU_SERVER_URL +
'"\n\nClick OK to navigate and accept it. ' +
'If no certificate warning is shown, then check that your OpenVidu Server is up and running at "' +
OPENVIDU_SERVER_URL +
'"',
)
) {
window.location.assign(OPENVIDU_SERVER_URL + '/accept-certificate');
}
}
});
});
}