]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed bug when using a localhost simple mjpeg url
authorCalin Crisan <ccrisan@gmail.com>
Tue, 14 Jul 2015 18:51:05 +0000 (21:51 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Tue, 14 Jul 2015 18:51:05 +0000 (21:51 +0300)
static/js/frame.js
static/js/main.js

index 0a911659e2ef84c9918dfadbf6eb1555bb67162a..276e100d72da89d56cb4899007b401fd44028468 100644 (file)
@@ -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; 
index d54264d833b28661285ebc6f845e1b13bc8b937c..3709a5e869e0462a94e54185834433580fe6e222 100644 (file)
@@ -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;
             }