]> www.vanbest.org Git - motioneye-debian/commitdiff
adapted cache prevention query argument for current snapshot
authorCalin Crisan <ccrisan@gmail.com>
Sat, 26 Oct 2013 15:58:58 +0000 (18:58 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 26 Oct 2013 15:58:58 +0000 (18:58 +0300)
doc/todo.txt
static/js/main.js

index 07de28b332401e187073bfb02ede086afdaeb9a6..32515b76d57cecd53961bbc00d4bbcc4ce701fee 100644 (file)
@@ -1,6 +1,4 @@
 -> add an autoupdate mechanism
--> cache jpegs from remote cameras locally
--> cache prevention query arg should be according to the refresh rate
 -> the camera is not available on page load, it is never shown afterwards - increase the timeout
 -> click to zoom on cameras
 -> make camera frames positions configurable
index 2c041ef771577fff55556483f4bea21000fa999b..ab6e94dcba62019ec2fc82141a70b0346ebaa8a9 100644 (file)
@@ -1323,8 +1323,13 @@ function refreshCameraFrames() {
         return;
     }
     
-    function refreshCameraFrame(cameraId, img) {
-        img.src = '/snapshot/' + cameraId + '/current/?_=' + new Date().getTime();
+    function refreshCameraFrame(cameraId, img, fast) {
+        var timestamp = new Date().getTime();
+        if (!fast) {
+            timestamp /= 500;
+        }
+        timestamp = Math.round(timestamp);
+        img.src = '/snapshot/' + cameraId + '/current/?_=' + timestamp;
     }
     
     var cameraFrames = $('div.page-container').find('div.camera-frame');
@@ -1343,7 +1348,7 @@ function refreshCameraFrames() {
         }
         else {
             var cameraId = this.id.substring(6);
-            refreshCameraFrame(cameraId, img);
+            refreshCameraFrame(cameraId, img, count <= 2); /* count <= 2 means at least 5 fps */
             
             this.refreshDivider = 0;
         }