From: Gavin Date: Wed, 10 Jan 2018 16:19:38 +0000 (-0800) Subject: When dialog is present we are most likely reviewing captured images/movies which... X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=39de61316128a7ac4dc0c12accb8585072e17cfa;p=motioneye-debian 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. --- 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 */