title: Ending WebRTC video call between two peers
body: <p>I've set up a video chat between two peers using <code>WebRTC</code>. I would like to allow a peer to end the chat and for the other peer to know that the chat was ended. Once the chat ends, some code needs to be executed for both peers. The <code>PeerConnection</code> object has a <code>removeStream()</code> method which should trigger the <code>onremovestream()</code> listener. This would be perfect for my use case, however, before onremovestream() is called there needs to be a re-negotiation (offer/answer) between the peers. For my case this seems odd. Why would I re-negotiate only to disconnect? Shouldn't the PeerConnection object realize no stream is coming from the other user? <strong>My question:</strong> how can I end a PeerConnection and alert the other user?</p>