Skip to content

Commit

Permalink
#702 add scheme if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Sep 7, 2018
1 parent 5c9970d commit 7c08aec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
31 changes: 26 additions & 5 deletions www/js/DataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2078,16 +2078,37 @@ angular.module('zmApp.controllers')
}
if (serverFound) {

if (!/^https?:\/\//i.test(multiservers[j].Server.Hostname)) {
multiservers[j].Server.Hostname = 'http://' + multiservers[j].Server.Hostname;
}

debug("Monitor " + monitors[i].Monitor.Id + " has a recording server hostname of " + multiservers[j].Server.Hostname);



// Now here is the logic, I need to retrieve serverhostname,
// and slap on the host protocol and path. Meh.

var p = URI.parse(loginData.streamingurl);
var s = URI.parse(multiservers[j].Server.Hostname);

// debug("recording server parsed is " + JSON.stringify(s));
// debug("portal parsed is " + JSON.stringify(p));
/* if (!p.port && !isNaN(p.path)) {
debug ("Portal: port path reversed?");
var tp = p.port;
p.port = p.path;
p.path = tp;
}
if (!s.port && !isNaN(s.path)) {
debug ("Recording: port path reversed?");
var tp = s.port;
s.port = s.path;
s.path = tp;
}
*/

debug("recording server parsed is " + JSON.stringify(s));
debug("portal parsed is " + JSON.stringify(p));

var st = "";
var baseurl = "";
Expand All @@ -2106,13 +2127,13 @@ angular.module('zmApp.controllers')

st += s.host;

// console.log ("STEP 1: ST="+st);
//console.log ("STEP 1: ST="+st);

if (zmsPort <= 0 || loginData.disableSimulStreaming) {
if (p.port || s.port) {
st += (s.port ? ":" + s.port : ":" + p.port);
streamingurl = st;
// console.log ("STEP 2 no ZMS: ST="+st);
//console.log ("STEP 2 no ZMS: ST="+st);

}

Expand All @@ -2122,7 +2143,7 @@ angular.module('zmApp.controllers')

if (p.port || s.port)
st += (s.port ? ":" + s.port : ":" + p.port);
// console.log ("STEP 2: ST="+st);
//console.log ("STEP 2: ST="+st);

}

Expand Down
1 change: 1 addition & 0 deletions www/js/MontageCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,7 @@ angular.module('zmApp.controllers')
return "";
}

//console.log ("STREAMING="+monitor.Monitor.streamingURL);
stream = monitor.Monitor.streamingURL +
"/nph-zms?mode=" + getMode() +
"&monitor=" + monitor.Monitor.Id +
Expand Down

0 comments on commit 7c08aec

Please sign in to comment.