diff --git a/web/skins/classic/views/js/montage.js b/web/skins/classic/views/js/montage.js index 51beb29d9..ad9878282 100644 --- a/web/skins/classic/views/js/montage.js +++ b/web/skins/classic/views/js/montage.js @@ -1103,6 +1103,15 @@ function changeMonitorStatusPositon() { // Kick everything off $j(window).on('load', () => initPage()); +//Stop monitors when closing page +document.onvisibilitychange = () => { + if (document.visibilityState === "hidden") { + for (let i = 0, length = monitorData.length; i < length; i++) { + monitors[i].kill(); + } + } +}; + /* window.onbeforeunload = function(e) { console.log('unload');