Closed Justin-Leung closed 6 years ago
Fixed, was destroying the PeerJS object everytime a user has an error. The fix was to remove that and add a reconnect for both the disabled and error emitted events. Also, within the error handler for the PeerJS object, I check if the error emitted was a peer-unavailable error and starts a new call.
That last part might be redundant, as on a reconnect I believe the 'open' emitted event handler is called which basically starts a call again.. Will check back later.
Currently, when an error occurs its "AUTOMATICALLY" disconnected from the PeerJS server.
To work around this, always force a reconnect, or, maybe check to see if it's connected or not.
https://github.com/peers/peerjs/commit/141db74484d638a391c6bc1f64ee2620ffbcd963