Ugly hack to work around the handling of stream key
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-12-08 01:54:18 +01:00
parent f5ad932b12
commit f1e309381a

View File

@ -199,11 +199,14 @@ export default {
case "ingest":
data["outputNeighbours"] = [];
break;
case "restreamer":
data["inputNeighbour"] = null;
data["outputURLs"] = new_node.data.url ? [new_node.data.url] : [];
case "restreamer": {
let fixed_thing = new_node.data.url.slice(-1) !== '/' ? new_node.data.url + '/' : new_node.data.url;
let full_url = new_node.data.url ? new URL("./" + new_node.data.streamkey, fixed_thing).href : null;
data["inputNeighbour"] = new_node ? new_node.apiId : null;
data["outputURLs"] = full_url ? [full_url] : full_url;
translated_type = "restream";
break;
}
case "encoder":
data["inputNeighbour"] = null;
data["outputNeighbours"] = []
@ -279,11 +282,14 @@ export default {
case "ingest":
data["outputNeighbours"] = map(output_neighbors, 'apiId');
break;
case "restreamer":
case "restreamer": {
let fixed_thing = changed_node.data.url.slice(-1) !== '/' ? changed_node.data.url + '/' : changed_node.data.url;
let full_url = changed_node.data.url ? new URL("./" + changed_node.data.streamkey, fixed_thing).href : null;
data["inputNeighbour"] = input_neighbor ? input_neighbor.apiId : null;
data["outputURLs"] = changed_node.data.url ? [changed_node.data.url] : [];
data["outputURLs"] = full_url ? [full_url] : full_url;
translated_type = "restream";
break;
}
case "encoder":
data["inputNeighbour"] = input_neighbor ? input_neighbor.apiId : null;
data["outputNeighbours"] = map(output_neighbors, 'apiId');
@ -357,13 +363,21 @@ export default {
height: apiNode.height
}
break;
case "restreamer":
case "restreamer": {
let full_url = apiNode.output_urls[0] || '';
let url = '';
let key = '';
if (full_url) {
url = full_url.substring(0, full_url.lastIndexOf("/") + 1);
key = full_url.substring(full_url.lastIndexOf("/") + 1, full_url.length);
}
newNode.data = {
url: apiNode.output_urls[0] || '',
streamkey: apiNode.stream_key
url: url,
streamkey: key
}
break;
}
}
newNode.id = this.idGenerator;
this.idGenerator++;