From 39de61316128a7ac4dc0c12accb8585072e17cfa Mon Sep 17 00:00:00 2001 From: Gavin Date: Wed, 10 Jan 2018 08:19:38 -0800 Subject: [PATCH] When dialog is present we are most likely reviewing captured images/movies which can cause a load of thumbnails to be downloaded. If we are capturing and reviewing on a Raspberry Pi 2 or lower then continuing to refresh the camera can cause very slow loading of the thumbnails. Since the camera(s) are at least partially obscured when the dialog is up, then pausing them seems acceptable. --- motioneye/static/js/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/motioneye/static/js/main.js b/motioneye/static/js/main.js index e11ff16..1097a06 100644 --- a/motioneye/static/js/main.js +++ b/motioneye/static/js/main.js @@ -4932,6 +4932,11 @@ function isFullScreen() { function refreshCameraFrames() { var timestamp = new Date().getTime(); + if ($('div.modal-container').is(':visible')) { + /* pause camera refresh if hidden by a dialog */ + return setTimeout(refreshCameraFrames, 1000); + } + function refreshCameraFrame(cameraId, img, serverSideResize) { if (refreshDisabled[cameraId]) { /* camera refreshing disabled, retry later */ -- 2.39.5