You need to replace deprecated onremovetrack with onconnectionstatechange:
Example:
connections[sid].onconnectionstatechange = function (event) {
const connectionStatus = event.currentTarget.connectionState;
if (["disconnected", "failed", "closed"].includes(connectionStatus)) {
// user has left the building
}
};
You need to replace deprecated
onremovetrack
withonconnectionstatechange
:Example: