From: Calin Crisan Date: Tue, 14 Jul 2015 18:51:05 +0000 (+0300) Subject: fixed bug when using a localhost simple mjpeg url X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=a291f90a0786d2a2c50c242d2192057fa0bf1cd7;p=motioneye-debian fixed bug when using a localhost simple mjpeg url --- diff --git a/static/js/frame.js b/static/js/frame.js index 0a91165..276e100 100644 --- a/static/js/frame.js +++ b/static/js/frame.js @@ -82,7 +82,7 @@ function refreshCameraFrame() { if (cameraFrame.proto == 'mjpeg') { /* no manual refresh for simple mjpeg cameras */ - var url = cameraFrame.url.replace('127.0.0.1', window.location.host); + var url = cameraFrame.url.replace('127.0.0.1', window.location.host.split(':')[0]); url += (url.indexOf('?') > 0 ? '&' : '?') + '_=' + new Date().getTime(); img.src = url; return; diff --git a/static/js/main.js b/static/js/main.js index d54264d..3709a5e 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1556,7 +1556,7 @@ function dict2CameraUi(dict) { if (dict['proto'] == 'mjpeg') { mjpgUrl = dict['url']; - mjpgUrl = mjpgUrl.replace('127.0.0.1', window.location.host); + mjpgUrl = mjpgUrl.replace('127.0.0.1', window.location.host.split(':')[0]); embedUrl = cameraUrl + 'frame/'; } else { @@ -3784,7 +3784,7 @@ function refreshCameraFrames() { if (!this.img) { this.img = $(this).find('img.camera')[0]; if (this.config['proto'] == 'mjpeg') { - var url = this.config['url'].replace('127.0.0.1', window.location.host); + var url = this.config['url'].replace('127.0.0.1', window.location.host.split(':')[0]); url += (url.indexOf('?') > 0 ? '&' : '?') + '_=' + new Date().getTime(); this.img.src = url; }