From: Calin Crisan <ccrisan@gmail.com>
Date: Sun, 14 Jun 2015 19:39:46 +0000 (+0300)
Subject: simple mjpeg cameras: don't look for motion detection cookie
X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=09a869c025c39318d2e8dea92e014eb6d5d6de47;p=motioneye-debian

simple mjpeg cameras: don't look for motion detection cookie
---

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');
             }