Error 'onClose' of null with Nodejs and WebRTC

Issue #4 new
Benjamin Schroeder created an issue

Please Helps -

I've installed the software from your guide and followed the directions and it works like a charm! I've created a Virtual Host on my server, video.mydomain.com and that works every time. It's super fast even.

However, when I move the <video id='localVideo'></video> and <video id='remoteVideo"></video> and the links to the JS and Sock.io files into the main domain. http://domain.com/video.html (I've updated the links <script src='http://video.mydomain.com/socket.io/socket.io.js'></script> <script src='http://video.mydomain.com/js/main.js'></script>)

I get this error... Uncaught TypeError: Cannot call method 'onClose' of null Uncaught TypeError: Cannot call method 'onClose' of null socket.io.js:1771

Any ideas? I've googed a bit and found pretty much nothing, other then the Js and Socket.io scripts should be local but I don't want them to be.

Comments (4)

  1. Sam Dutton repo owner

    Hi Benjamin

    I've installed the software from your guide and followed the directions and

    it works like a charm

    Glad to hear it :)!

    I get this error...

    Do you have server.js (as in the codelab) running on Node, with socket.ioinstalled (npm install socket.io)?

    You need to leave the script src as it is in the codelab, so it's served correctly:

    <script src='/socket.io/socket.io.js'></script>
    

    Hope that helps.

    Sam

  2. Benjamin Schroeder reporter

    Hi Sam,

    Thank you for your reply.

    I have socket.io and node-static installed via npm into a directory.

    My directories looks like this.

    • www
      • mydomain.com
        • public_html
        • video (nodejs / socket.io etc)

    When I launch "node server.js" from the command line in the video directory and load video.mydomain.com in a browser it works perfect. I have created a Virtual Host.

    However I have CodeIgniter in the public_html directory, for the rest of my website. In my video.php view, I've put the link to the main.js and the socket.io.js at the bottom. With an MVC framework this link calls for a socket.io controller, and socket.io.js function and that just doesn't work. So I put the full http:// url in that link, and it seems to work fine, by viewing the source I can see its linking ok. I just get that error referenced above.

    what can I do?

  3. Sam Dutton repo owner

    Sorry – got waylaid by other projects and didn't respond. Did you manage to resolve this?

  4. Sam Dutton repo owner

    Hi @pdxbenjamin – did you manage to resolve this? If I don't hear further I'll close the issue.

  5. Log in to comment