MenuMenu

RTCMultiConnection.onPeerStateChanged

Check if ice-connection statuses for all connected users

How to use

connection.onPeerStateChanged = function(state) {
    if (state.iceConnectionState.search(/closed|failed/gi) !== -1) {
        console.error('Peer connection is closed between you & ', state.userid, state.extra, 'state:', state.iceConnectionState);
    }
};

Here is a demo that is using this API: demos/getStats.html