To be honest, I cannot find the error. Although, It only happens sometimes and when the user is in the videoroom for about 15-30 minutes or so. It's really hard to debug it as it happens randomly, not always.
I also have fixed an error in this block of code (
https://github.com/meetecho/janus-gateway/blob/master/html/videoroomtest.js#L601-L614) as it is called twice when a remote user joins in. For example, when a user refreshes the page, the first interval call (which was supposed to be overriden with the second one) is still working somehow. To fix this, I've added both intervals into an array of interval timers, then cleaned all intervals for that handle in the cleanup notification function. It is a surprise that it does not throw an "Invalid handle" error in your demos, but it does in my app, as it basically uses the same function, with some aggregations that does not interfere with the videoroom JS nor the Janus JS.
I will keep an eye on the logs and try to find if there is an error in my logic. I'll keep you updated.
Best regards.
D.