]> www.vanbest.org Git - motioneye-debian/commitdiff
simple mjpeg cameras: prevent image caching
authorCalin Crisan <ccrisan@gmail.com>
Sat, 13 Jun 2015 07:31:02 +0000 (10:31 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 13 Jun 2015 07:31:02 +0000 (10:31 +0300)
static/js/frame.js
static/js/main.js

index 81fa55aef4728239024b0626d6c303219f7c4b0e..93ed060189efeb4f600b8fac1f0a98a08aa64489 100644 (file)
@@ -82,7 +82,9 @@ function refreshCameraFrame() {
     
     if (cameraFrame.proto == 'mjpeg') {
         /* no manual refresh for simple mjpeg cameras */
-        img.src = cameraFrame.url.replace('127.0.0.1', window.location.host);
+        var url = cameraFrame.url.replace('127.0.0.1', window.location.host);
+        url += (url.indexOf('?') > 0 ? '&' : '?') + '_=' + new Date().getTime();
+        img.src = url;
         return; 
     }
     
index 0d6f09f4da6d76ea1b88869ba565b0c0480dc705..e3dccc8237972ff99a9a9fad657b91316c0141ba 100644 (file)
@@ -3803,7 +3803,9 @@ function refreshCameraFrames() {
         if (!this.img) {
             this.img = $(this).find('img.camera')[0];
             if (this.config['proto'] == 'mjpeg') {
-                this.img.src = this.config['url'].replace('127.0.0.1', window.location.host);
+                var url = this.config['url'].replace('127.0.0.1', window.location.host);
+                url += (url.indexOf('?') > 0 ? '&' : '?') + '_=' + new Date().getTime();
+                this.img.src = url;
             }
         }