CC-3224: "On-the-fly" stream rebroadcasting

- Live source is created when only both port and mount point are specified
This commit is contained in:
James 2012-02-23 11:51:20 -05:00
parent 30901aa0d6
commit 1ebe3d1812
5 changed files with 16 additions and 8 deletions

View File

@ -206,9 +206,10 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_StreamSetting::setStreamSetting($values); Application_Model_StreamSetting::setStreamSetting($values);
$data = array(); $data = array();
$data['setting'] = Application_Model_StreamSetting::getStreamSetting(); $info = Application_Model_StreamSetting::getStreamSetting();
$data['setting']['harbor_input_port'] = $values["harbor_input_port"]; $info[] = (array("keyname" =>"harbor_input_port", "value"=>$values["harbor_input_port"], "type"=>"integer"));
$data['setting']['harbor_input_mount_point'] = $values["harbor_input_mount_point"]; $info[] = (array("keyname" =>"harbor_input_mount_point", "value"=>$values["harbor_input_mount_point"], "type"=>"string"));
$data['setting'] = $info;
for($i=1;$i<=$num_of_stream;$i++){ for($i=1;$i<=$num_of_stream;$i++){
Application_Model_StreamSetting::setLiquidsoapError($i, "waiting"); Application_Model_StreamSetting::setLiquidsoapError($i, "waiting");
} }

View File

@ -32,6 +32,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$master_password->setAttrib('autocomplete', 'off') $master_password->setAttrib('autocomplete', 'off')
->setAttrib('renderPassword','true') ->setAttrib('renderPassword','true')
->setAllowEmpty(true) ->setAllowEmpty(true)
->setValue(Application_Model_Preference::GetLiveSteamMasterPassword())
->setLabel('Master Password') ->setLabel('Master Password')
->setFilters(array('StringTrim')) ->setFilters(array('StringTrim'))
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));

View File

@ -722,7 +722,7 @@ class Application_Model_Preference
} }
public static function SetLiveSteamMasterPassword($value){ public static function SetLiveSteamMasterPassword($value){
self::SetValue("live_stream_master_password", md5($value), false); self::SetValue("live_stream_master_password", $value, false);
} }
public static function GetLiveSteamMasterPassword(){ public static function GetLiveSteamMasterPassword(){

View File

@ -373,7 +373,7 @@ class AirTimeApiClient(ApiClientInterface):
url = url.replace("%%api_key%%", self.config["api_key"]) url = url.replace("%%api_key%%", self.config["api_key"])
url = url.replace("%%username%%", username) url = url.replace("%%username%%", username)
url = url.replace("%%password%%", hashlib.md5(password).hexdigest()) url = url.replace("%%password%%", password)
req = urllib2.Request(url) req = urllib2.Request(url)
response = urllib2.urlopen(req).read() response = urllib2.urlopen(req).read()

View File

@ -54,10 +54,16 @@ def check_client(user,password) =
end end
end end
live = input.harbor(harbor_input_mount_point, port=harbor_input_port, auth=check_client) def configure_live(harbor_input_port, harbor_input_mount_point) =
if harbor_input_port != 0 and harbor_input_mount_point != "" then
s = fallback(track_sensitive=false, [live, queue, default]) live = input.harbor(harbor_input_mount_point, port=harbor_input_port, auth=check_client)
fallback(track_sensitive=false, [live, queue, default])
else
fallback(track_sensitive=false, [queue, default])
end
end
s = configure_live(harbor_input_port, harbor_input_mount_point)
s = on_metadata(notify, s) s = on_metadata(notify, s)
s = crossfade(s) s = crossfade(s)
# Attach a skip command to the source s: # Attach a skip command to the source s: