I have deployed the code and MP4 file on server end as you described but still I am getting black video. @mihailj Below is my code
const connect = function (fileName, SESSION_ID) {
try {
var postData = JSON.stringify({
type: "IPCAM",
rtspUri: "file:///opt/openvidu/recordings/" + fileName + ".mp4",
adaptativeBitrate: true,
onlyPlayWithSubscribers: true,
networkCache: 2000,
data: "IP-CAM",
});
var options = {
hostname: HOST_NAME,
port: 4443,
path: "/openvidu/api/sessions/" + SESSION_ID + "/connection",
method: "POST",
headers: {
Authorization: "Basic " + btoa("OPENVIDUAPP:" + SECRET),
"Content-Type": "application/json",
"Content-Length": postData.length,
},
};
var req = https.request(options, (res) => {
console.log("statusCode:", res.statusCode);
console.log("headers:", res.headers);
res.on("data", (d) => {
console.log("loaded");
});
});
req.on("error", (e) => {
console.error(e);
});
req.write(postData);
req.end();
} catch (e) {
console.log(e.message);
}
};