Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
e4959739dc
|
@ -21,8 +21,9 @@ function setjPlayer(url, type){
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$('.bit-rates').click(function(eventObject){
|
$("#combo-box").change(function(eventObject){
|
||||||
var elem = $(eventObject.target);
|
var elem = $("#combo-box option:selected");
|
||||||
|
console.log(elem);
|
||||||
|
|
||||||
setjPlayer(elem.attr("data-url"), elem.attr("data-type"));
|
setjPlayer(elem.attr("data-url"), elem.attr("data-type"));
|
||||||
});
|
});
|
||||||
|
@ -45,22 +46,20 @@ $(document).ready(function(){
|
||||||
<div class="jp-stream-text">Select stream:</div>
|
<div class="jp-stream-text">Select stream:</div>
|
||||||
<form id="form1" method="post" action="">
|
<form id="form1" method="post" action="">
|
||||||
|
|
||||||
<?php
|
<select id="combo-box">
|
||||||
$i=0;
|
<?php
|
||||||
foreach($ids as $id):
|
foreach($ids as $id) {
|
||||||
$streamData = Application_Model_StreamSetting::getStreamData($id);
|
$streamData = Application_Model_StreamSetting::getStreamData($id);
|
||||||
Logging::log("id: ".print_r($streamData, true));
|
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
|
||||||
|
$type = $streamData["${id}_type"];
|
||||||
|
if ($type == "ogg")
|
||||||
|
$type = "oga";
|
||||||
|
|
||||||
$url = "http://".$streamData["${id}_host"].":".$streamData["${id}_port"]."/".$streamData["${id}_mount"];
|
$label = "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]." Kbit/s)";
|
||||||
$type = $streamData["${id}_type"];
|
echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s'>%s</option>", $id, $url, $type, $label);
|
||||||
|
}
|
||||||
if ($type == "ogg")
|
|
||||||
$type = "oga";
|
|
||||||
?>
|
?>
|
||||||
<label>
|
</select>
|
||||||
<input class='bit-rates' type="radio" name="select-stream" value="radio" data-url="<?php echo $url ?>" data-type="<?php echo $type ?>" id="select-stream_<?php echo $id ?>" <?php echo $i==0 ? "checked=\"checked\"": ""; ?>/>
|
|
||||||
<?php echo "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]; ?> Kbit/s)</label>
|
|
||||||
<?php $i++; endforeach; ?>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
||||||
|
|
|
@ -54,6 +54,8 @@ python ${SCRIPTPATH}/../python_apps/show-recorder/install/recorder-install.py
|
||||||
echo -e "\n*** Media Monitor Installation ***"
|
echo -e "\n*** Media Monitor Installation ***"
|
||||||
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
python ${SCRIPTPATH}/../python_apps/media-monitor/install/media-monitor-install.py
|
||||||
|
|
||||||
|
python ${SCRIPTPATH}/../python_apps/icecast2/install/icecast2-install.py
|
||||||
|
|
||||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||||
# so we can ensure they can register with monit to monitor them when they start.
|
# so we can ensure they can register with monit to monitor them when they start.
|
||||||
# If monit is already running, this step is still useful as we need monit to
|
# If monit is already running, this step is still useful as we need monit to
|
||||||
|
|
|
@ -102,6 +102,8 @@ passthru("python $SCRIPTPATH/../../python_apps/show-recorder/install/recorder-in
|
||||||
echo PHP_EOL."*** Updating Media Monitor ***".PHP_EOL;
|
echo PHP_EOL."*** Updating Media Monitor ***".PHP_EOL;
|
||||||
passthru("python $SCRIPTPATH/../../python_apps/media-monitor/install/media-monitor-install.py");
|
passthru("python $SCRIPTPATH/../../python_apps/media-monitor/install/media-monitor-install.py");
|
||||||
|
|
||||||
|
passthru("python $SCRIPTPATH/../../python_apps/icecast2/install/icecast2-install.py");
|
||||||
|
|
||||||
sleep(4);
|
sleep(4);
|
||||||
passthru("airtime-check-system");
|
passthru("airtime-check-system");
|
||||||
|
|
||||||
|
|
|
@ -341,7 +341,6 @@ class AirtimeIni200{
|
||||||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||||
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||||
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
|
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
|
||||||
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
|
|
||||||
|
|
||||||
const CONF_PYPO_GRP = "pypo";
|
const CONF_PYPO_GRP = "pypo";
|
||||||
const CONF_WWW_DATA_GRP = "www-data";
|
const CONF_WWW_DATA_GRP = "www-data";
|
||||||
|
@ -405,7 +404,7 @@ class AirtimeIni200{
|
||||||
foreach ($configFiles as $conf) {
|
foreach ($configFiles as $conf) {
|
||||||
// we want to use new liquidsoap.cfg so don't merge
|
// we want to use new liquidsoap.cfg so don't merge
|
||||||
// also for monit
|
// also for monit
|
||||||
if( $conf == AirtimeIni200::CONF_FILE_LIQUIDSOAP || $conf == AirtimeIni200::CONF_FILE_MONIT){
|
if( $conf == AirtimeIni200::CONF_FILE_LIQUIDSOAP){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (file_exists("$conf$suffix.bak")) {
|
if (file_exists("$conf$suffix.bak")) {
|
||||||
|
@ -493,7 +492,7 @@ class AirtimeIni200{
|
||||||
$suffix = date("Ymdhis")."-2.0.0";
|
$suffix = date("Ymdhis")."-2.0.0";
|
||||||
foreach ($configFiles as $conf) {
|
foreach ($configFiles as $conf) {
|
||||||
// do not back up monit cfg
|
// do not back up monit cfg
|
||||||
if (file_exists($conf) && $conf != AirtimeIni200::CONF_FILE_MONIT) {
|
if (file_exists($conf)) {
|
||||||
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
||||||
//copy($conf, $conf.$suffix.".bak");
|
//copy($conf, $conf.$suffix.".bak");
|
||||||
exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes
|
exec("cp -p $conf $conf$suffix.bak"); //use cli version to preserve file attributes
|
||||||
|
@ -538,10 +537,6 @@ class AirtimeIni200{
|
||||||
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (!copy(__DIR__."/airtime-monit.cfg.$suffix", AirtimeIni200::CONF_FILE_MONIT)){
|
|
||||||
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||||
|
<xsl:template match="@*|node()">
|
||||||
|
<xsl:copy>
|
||||||
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
|
</xsl:copy>
|
||||||
|
</xsl:template>
|
||||||
|
</xsl:stylesheet>
|
|
@ -0,0 +1,22 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import shutil
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
if os.geteuid() != 0:
|
||||||
|
print "Please run this as root."
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
def get_current_script_dir():
|
||||||
|
current_script_dir = os.path.realpath(__file__)
|
||||||
|
index = current_script_dir.rindex('/')
|
||||||
|
return current_script_dir[0:index]
|
||||||
|
|
||||||
|
try:
|
||||||
|
current_script_dir = get_current_script_dir()
|
||||||
|
shutil.copy(current_script_dir+"/../airtime-icecast-status.xsl", "/usr/share/icecast2/web")
|
||||||
|
|
||||||
|
except Exception, e:
|
||||||
|
print "exception: %s" % e
|
||||||
|
sys.exit(1)
|
Loading…
Reference in New Issue