asp.net-mvcvisual-studio-2015iis-expressquickblox

QuickBlox Video Chat Demo Web Sample: "this.socket is undefined" after calling start call


I am getting "this.socket is undefined" error in QuickBlox Video Chat Demo Sample. It's works fine when I run it locally (from local file system) but if I integrate it to a ASP.NET MVC application which running on local IIS Espress (Visual Studio 2015) I am getting below error in Firefox console window the moment I click on "Start Call" and accept to share audio/video deviec media:

this.socket is undefined QB.js:8111:0
[QBWebRTC]: _dialingCallback, answerTimeInterval: 5000 QB.js:1620:32
TypeError: this.socket is undefined
QB.js:8111:175
[QBWebRTC]: _dialingCallback, answerTimeInterval: 10000 QB.js:1620:32
TypeError: this.socket is undefined
QB.js:8111:175
[QBWebRTC]: _dialingCallback, answerTimeInterval: 15000 QB.js:1620:32
TypeError: this.socket is undefined
QB.js:8111:175
[QBWebRTC]: _dialingCallback, answerTimeInterval: 20000 QB.js:1620:32
TypeError: this.socket is undefined
QB.js:8111:175
[QBWebRTC]: _dialingCallback, answerTimeInterval: 25000 QB.js:1620:32
TypeError: this.socket is undefined

Here "QB.JS" is a unminified version of QuickBlox JS SDK. I did it, so that can get to know which code block in JS SDK throwing the error

QuickBlox documentation says that, it should be run over HTTPS for security reason and so I tried that as well by enabling SSL and attaching a self signed certificate but NO LUCK

Can you shed some light here as to what going wrong and why such weird undocumented behavior I am seeing.

NOTE: It's the same sample I have downloaded from GitHib (Following QuickBlox documentation page) and haven't change anything except the config file to include my own "AppId/AuthKey/AuthSecrect and few demo users"


Solution

  • In case you are facing the same make sure

    You haven't already initiated the QB framework by saying QB.Init()

    You haven't already have a chat session opened. My observation: if you have a XMPP chat session opened by saying QB.createSession() and you are trying to create a video webrtc session it gives this weird error.

    In case, you need to create a session for some purpose then destroy it before opening a video session like:

    QB.createSession(function(res, err)
    {
      if(err)
       console.log(JSON.Stringify(err));
    else
       //do your stuff here and once done
    
    QB.Destroysession(function(){
    }
    });
    });
    

    Now you can go ahead and start creating a video session and it will work just fine. You can view the actual GitHub post here https://github.com/QuickBlox/quickblox-javascript-sdk/issues/125