PeerJS Stream Call not working #1319
-
I am working on sending a stream through PeerJS. Everything works until you call the other peer; the other peer receives the call and not the stream. It responds to .on("call", func) and not .on("stream", func). Do any of you have any idea why this is not working? (code attached in zip because it would allow me to upload the index.html) Also, before you tell me to do anything in the terminal or install anything, my computer can't do that because of some stupid thing about how my parents set up my user account. I've researched a solution and come to the conclusion that I just need to wait until my new computer comes in, so don't bother addressing that. Using only the online PeerJS library and writing code in a file, is there a solution? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey cool to see you building stuff! PeerJS has 3 main types, Peers, DataConnections, MediaConnections. As per peerjs docs, it's not I updated your example, added some more listeners and clarified prints outs and variables a bit, probably have some copy paste wrong messages, but pretty close. see below. This example on peerjs docs is sorta similar to yours https://github.com/jmcker/Peer-to-Peer-Cue-System/tree/main is pretty good to help understand the event listening and such. For media stuff this is an example I have seen as well https://github.com/oxedom/parker (I am sure there are others) FYI, PeerJS is not really actively maintained. Their server (for creating connections) gets overloaded a lot so it's a bit painful to use them as a dev because you don't know if it's your bug or the peerJS server (see issue here). I normally will spin up a local server when I am using peerJS to protect my sanity.
It's cool that your trying things and asking for help. But this
From https://stackoverflow.com/help/how-to-ask -> https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/ I'd love to connect and hear about the what you're building and interested in. Chat on discord? I'm gherman_cs there
|
Beta Was this translation helpful? Give feedback.
Hey cool to see you building stuff!
PeerJS has 3 main types, Peers, DataConnections, MediaConnections.
peer.call
creates mediaConnections,peer.connect
creates dataConnections.As per peerjs docs, it's not
peer.on('stream
itsmediaconnection.on('stream'
I updated your example, added some more listeners and clarified prints outs and variables a bit, probably have some copy paste wrong messages, but pretty close. see below.
This example on peerjs docs is sorta similar to yours https://github.com/jmcker/Peer-to-Peer-Cue-System/tree/main is pretty good to help understand the event listening and such. For media stuff this is an example I have seen as well https://github.com/oxedom/parker (I am…