ConnectyCube / connectycube-js-sdk-releases

Releases materials for ConnectyCube JS SDK platform https://connectycube.com
9 stars 2 forks source link

onRemoteStreamListener is not triggered #17

Closed coderpradp closed 4 years ago

coderpradp commented 4 years ago

So, after initiating and accepting call I can see the local stream however, the onRemoteStreamListener callback is never received by caller and opponent. I have attached the log for both caller and opponent below. call accepter log.log call initiater log.log

If it helps, I am setting the listeners only after chat signal is connected:

createConnectyCubeChatSession(user) {
    ConnectyCube.createSession(user)
        .then(() => ConnectyCube.chat.connect({ userId: user.id, password: user.password }))
        .then(() => {
            this.$refs.OverlayVideoCall.initListeners(); // reference to another component in Vue.js
        })
        .catch(err => {
            console.log('Error creating ConnectyCube chat session')
        });
}
coderpradp commented 4 years ago

I forgot to pass the sessionType and additionalOptions to the createNewSession method which was causing the issue.

const sessionType = ConnectyCube.videochat.CallType.VIDEO; // AUDIO is also possible
const additionalOptions = {};
const session = ConnectyCube.videochat.createNewSession(calleesIds, sessionType, additionalOptions);