From 09a869c025c39318d2e8dea92e014eb6d5d6de47 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 14 Jun 2015 22:39:46 +0300 Subject: [PATCH] simple mjpeg cameras: don't look for motion detection cookie --- static/js/frame.js | 2 +- static/js/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/frame.js b/static/js/frame.js index 93ed060..028279d 100644 --- a/static/js/frame.js +++ b/static/js/frame.js @@ -50,7 +50,7 @@ function setupCameraFrame() { /* there's no point in looking for a cookie update more often than once every second */ var now = new Date().getTime(); - if (!this.lastCookieTime || now - this.lastCookieTime > 1000) { + if ((!this.lastCookieTime || now - this.lastCookieTime > 1000) && (cameraFrameDiv[0].proto != 'mjpeg')) { if (getCookie('motion_detected_' + cameraId) == 'true') { cameraFrameDiv.addClass('motion-detected'); } diff --git a/static/js/main.js b/static/js/main.js index e3dccc8..6b7a109 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -3605,7 +3605,7 @@ function addCameraFrameUi(cameraConfig) { /* there's no point in looking for a cookie update more often than once every second */ var now = new Date().getTime(); - if (!this.lastCookieTime || now - this.lastCookieTime > 1000) { + if ((!this.lastCookieTime || now - this.lastCookieTime > 1000) && (cameraFrameDiv[0].config['proto'] != 'mjpeg')) { if (getCookie('motion_detected_' + cameraId) == 'true') { cameraFrameDiv.addClass('motion-detected'); } -- 2.39.5