Skip to content

Commit 50454f2

Browse files
Add second path to rtsp2web
1 parent 9afec50 commit 50454f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/zm_monitor_rtsp2web.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,14 @@ int Monitor::RTSP2WebManager::add_to_RTSP2Web() {
107107
std::string endpoint = RTSP2Web_endpoint+"/stream/"+std::to_string(parent->id)+"/add";
108108

109109
//Assemble our actual request
110-
std::string postData = "{\"name\" : \"";
111-
postData += std::string(parent->Name());
112-
postData += "\", \"channels\" : { \"0\" : {";
113-
postData += "\"name\" : \"ch1\", \"url\" : \"";
114-
postData += rtsp_path;
115-
postData += "\", \"on_demand\": true, \"debug\": false, \"status\": 0}}}";
110+
std::string postData = "{\"name\" : \"" + std::string(parent->Name()) + "\", \"channels\" : {"
111+
" \"0\" : {"
112+
" \"name\" : \"ch1\", \"url\" : \"" + rtsp_path + "\", \"on_demand\": true, \"debug\": false, \"status\": 0}";
113+
if (!parent->GetSecondPath().empty()) {
114+
postData += ", \"0\" : {"
115+
" \"name\" : \"ch2\", \"url\" : \"" + parent->GetSecondPath() + "\", \"on_demand\": true, \"debug\": false, \"status\": 0}";
116+
}
117+
postData += "}" "}";
116118

117119
Debug(1, "Sending %s to %s", postData.c_str(), endpoint.c_str());
118120

0 commit comments

Comments
 (0)