peerjs icon indicating copy to clipboard operation
peerjs copied to clipboard

working example?

Open gittyup2018 opened this issue 5 years ago • 1 comments

Is there a working client example? There seems not to be any working example on the peerjs site, this respository and even the https://github.com/peers/peerjs-examples is completely empty. I found https://cdn.peerjs.com/demo/videochat from a google search but that gives a 404 error also.

Do I have to accept the offer before actually connecting? I thought I only have to pass the connection ID.

I was trying to make my own simple chat/text based demo on the documentation but it seems to not be able to send or receive data. I receive the offer but don't know what else to do? Someone mentioned

peer.on('connection', function(conn) { conn.open = true });

but this .open is not documented, is that for video/audio calls only?

Do I still have to call the call event for simple strings or is that video/audio calls only? because I never receive the on('data' conn event from

conn.on('open', function() { console.log("CONNECTED");

// Receive messages conn.on('data', function(data) { console.log('Received> ', data); });

// Send messages conn.send('Hello!'); });

The console displays CONNECTED, but not the hello message.

Do I only have to connect to a remote peer once to initialize the connection? Or does the remote peer have to call connect back to the initializer peer id? both seem to not work.

gittyup2018 avatar Jul 06 '20 20:07 gittyup2018

Same issue as #693.

Andy-Kerr avatar Jul 07 '20 23:07 Andy-Kerr