I am initiating a video call with the ConnectyCube videochat
API. In their example app the session object returned from the code below includes a localStream
object. I cannot however get this to work - localStream
is always null
.
const getSession = (calleesIds) => {
return new Promise((resolve, reject) => {
const sessionType = ConnectyCube.videochat.CallType.VIDEO;
const additionalOptions = {};
const session = ConnectyCube.videochat.createNewSession(calleesIds, sessionType, additionalOptions);
console.log(session)
resolve(session);
})
}
When debugging their example app, the session object looks like this:
but mine looks like this:
The object then gets passed to the getUserMedia
function:
const getUserMedia = session => {
return new Promise((resolve, reject) => {
session.getUserMedia({
audio: true,
video: { facingMode: 'user' }
}, function(error, stream) {
error ? reject(error) : resolve(stream);
});
});
}
However this returns the error TypeError: Cannot read property 'getUserMedia' of undefined
.
Update
Still unable to solve this - it should be possible to figure it out by comparing the functional example app linked to above to my code.