otalk / RTCPeerConnection

A tiny browser module that gives normalizes and simplifies the API for WebRTC peer connections.
200 stars 60 forks source link

Package fails after running #54

Closed talbenbasat closed 8 years ago

talbenbasat commented 8 years ago

Hi,

I'm trying to use this package in my node server. Unfortunately the package fails to run, since it depends on traceable peer connection, and traceablepeerconnection uses window.

Do you have any solution for this manner.

can I use this without a browser?

this.peerconnection = new window.RTCPeerConnection(config, constraints);
                              ^
ReferenceError: window is not defined
    at new TraceablePeerConnection (/intermidiate/node_modules/rtcpeerconnection/node_modules/traceablepeerconnection/index.js:35:31)
    at new PeerConnection (/home/tal/Code/WebstormProjects/intermidiate/node_modules/rtcpeerconnection/rtcpeerconnection.js:115:15)
    at makeOffer (/intermidiate/public/serverless-webrtc-create/serverless-webrtc.js:79:8)
    at Object.<anonymous> (/intermidiate/public/serverless-webrtc-create/serverless-webrtc.js:130:1)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
fippo commented 8 years ago

node is not supported by this package. https://www.npmjs.com/package/wrtc provides datachannel apis for node if that is what you're looking for.

talbenbasat commented 8 years ago

it's not working for me so i was looking for alternatives