i-aryan / quickmeet

A video chat/meeting webapp using WebRTC and WebSockets. Basically a Google Meet clone + a collaborative Whiteboard.
MIT License
121 stars 66 forks source link

onremovetrack -> onconnectionstatechange #19

Open ugnich opened 3 years ago

ugnich commented 3 years ago

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
        }
    };