You have to use onDisconnect() when you are online. The client can't communicate with the server when it's offline so the onDisconnect() operation won't take place until you are next online. You can change the code to:
connectedRef.on("value", function(isOnline) {
if (isOnline.val() === true) {
console.log('Connected to Firebase');
// FIRE FUNCTION TO CONNECT TO THE MEETING
connectToMeeting();
// REMOVE USER FROM FIREBASE ON DISCONNECT
myUserRef.onDisconnect().remove();
}
}
Hope this helps!