From: Calin Crisan Date: Sat, 13 Jun 2015 07:31:02 +0000 (+0300) Subject: simple mjpeg cameras: prevent image caching X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=1870be87cb78c8130daaf0684cf4297ed586204d;p=motioneye-debian simple mjpeg cameras: prevent image caching --- diff --git a/static/js/frame.js b/static/js/frame.js index 81fa55a..93ed060 100644 --- a/static/js/frame.js +++ b/static/js/frame.js @@ -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; } diff --git a/static/js/main.js b/static/js/main.js index 0d6f09f..e3dccc8 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -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; } }