SAAS-587: Add stream urls to station-metadata API

This commit is contained in:
drigato 2015-02-20 15:50:40 -05:00
parent a931e282e1
commit 6dcc7ee2fc
3 changed files with 18 additions and 1 deletions

View file

@ -62,6 +62,22 @@ class Application_Model_StreamSetting
return $result ? $result : "";
}
public static function getEnabledStreamUrls()
{
$urls = Array();
$streamIds = Application_Model_StreamSetting::getEnabledStreamIds();
foreach ($streamIds as $id) {
$prefix = $id."_";
$streamData = Application_Model_StreamSetting::getStreamData($id);
$host = $streamData[$prefix."host"];
$port = $streamData[$prefix."port"];
$mount = $streamData[$prefix."mount"];
$type = $streamData[$prefix."type"];
$urls[$type] = "http://$host:$port/$mount";
}
return $urls;
}
/* Returns the id's of all streams that are enabled in an array. An
* example of the array returned in JSON notation is ["s1", "s2", "s3"] */
public static function getEnabledStreamIds()