muaz-khan / Canvas-Designer

Collaborative, extendable, JavaScript Canvas2D drawing tool, supports dozens of builtin tools, as well as generates JavaScript code for 2D animations.
https://www.webrtc-experiment.com/Canvas-Designer/
MIT License
368 stars 171 forks source link

The init function in RTCMultiConnect.js has a line this.connection = new RTCPeerConnection(this.iceServers, this.optionalArgument); On this line RTCPeerConnection is undefined. #5

Closed creedrahul closed 8 years ago

creedrahul commented 8 years ago

i have tried to debug the code by creating a new function with the same name but then i start get other errors. any help is appreciated

muaz-khan commented 8 years ago

RTCPeerConnection object is defined here:

The line you referenced is using it here:

Please make sure that you're using this RTCMultiConnection file via rawgit.com or download to local system:

creedrahul commented 8 years ago

I have downloaded the file to local system but the error is still there. i get the error from init function in RTCMulitiConnect.js. (while debugging the error is throws at line 4107 RTCMulitiConnect.js)

muaz-khan commented 8 years ago

Please make sure that you are NOT using adapter.js or similar solutions.

Open Chrome Console (ctrl+shift+i or command+option+i) and type RTCPeerConnection. Chrome console MUST throw error because RTCPeerConnection is hidden object. If it shows some kind of function then either remove adapter.js or modify RTCMultiConnection.js as following:

var RTCPeerConnection = window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
var RTCSessionDescription = window.RTCSessionDescription || window.mozRTCSessionDescription;
var RTCIceCandidate = window.RTCIceCandidate || window.mozRTCIceCandidate;

If you'll keep using adapter.js then RTCMultiConnection MAY-NOT work in latest Firefox releases. (where mozRTCPeerConnection is expected to be removed, soon)