DEV Community

Discussion on: Building a Video Chat App with Socket.io, PeerJS, Codesphere

Collapse
 
naonvl profile image
naonvl

how to end the call?

Collapse
 
liorbd profile image
Lior Ben-David

Hi Naonvl,
To disconnect from the PeerJS Server, and then end the call, you can set up a button in the ejs file that triggers the following command:
myPeer.disconnect()
You can read more about handling disconnects in the peerJS documentation here:
peerjs.com/docs.html#peerdisconnect

Best,
Lior