Hello, I have a question while publishing ip camera with openvidu.
I write this code according to IP cameras example and openvidu server using docker run -p 4443:4443 --rm -e OPENVIDU_SECRET=MY_SECRET openvidu/openvidu-server-kms:2.15.0
return new Promise((resolve, reject) => {
const body = JSON.stringify({ "rtspUri": rtspUri,
"adaptativeBitrate": true,
"onlyPlayWithSubscribers": true
});
const options = {
headers: new HttpHeaders({
'Authorization': 'Basic ' + btoa('OPENVIDUAPP:' + this.MY_SECRET),
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': "*"
}),
};
return this.http
.post<any>(this.OPENVIDU_SERVER_URL + '/api/sessions/' + sessionId + '/connection', body, options)
.pipe(
catchError((error) => {
error.status === 409 ? resolve(sessionId) : reject(error);
return observableThrowError(error);
}),
)
.subscribe((response) => {
resolve(response.id);
});
});
The result I got hew hours ago is this, at this time, it can get an object.
But this time, it returns an error.
It is difficult because it’s my first time doing openvidu and ionic. I’m sorry…