CC-2727: Limit number of streams and max bitrate

- create airtime-stream php script to set number of streams and max bitrate
- the stream section itself is not displayed rather than grey out
This commit is contained in:
james 2011-08-26 15:41:20 -04:00
parent d992457bd5
commit b92793e80f
6 changed files with 146 additions and 4 deletions

View file

@ -139,12 +139,15 @@ class PreferenceController extends Zend_Controller_Action
}
$temp_bitrate = Application_Model_Preference::GetStreamBitrate();
$max_bitrate = intval(Application_Model_Preference::GetMaxBitrate());
$stream_bitrates = array();
foreach ($temp_bitrate as $type){
$stream_bitrates[trim($type)] = strtoupper(trim($type))." Kbit/s";
if(intval($type) <= $max_bitrate){
$stream_bitrates[trim($type)] = strtoupper(trim($type))." Kbit/s";
}
}
$num_of_stream = 3;
$num_of_stream = intval(Application_Model_Preference::GetNumOfStream());
$form = new Application_Form_StreamSetting();
$form->setSetting($setting);
$form->startFrom();

View file

@ -7,7 +7,7 @@ class Application_Model_Preference
global $CC_CONFIG, $CC_DBC;
//called from a daemon process
if(!Zend_Auth::getInstance()->hasIdentity()) {
if(!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) {
$id = NULL;
}
else {
@ -394,5 +394,21 @@ class Application_Model_Preference
public static function GetPrivacyPolicyCheck(){
return Application_Model_Preference::GetValue("privacy_policy");
}
public static function SetNumOfStream($num){
Application_Model_Preference::SetValue("num_of_streams", intval($num));
}
public static function GetNumOfStream(){
return Application_Model_Preference::GetValue("num_of_streams");
}
public static function SetMaxBitrate($bitrate){
Application_Model_Preference::SetValue("max_bitrate", intval($bitrate));
}
public static function GetMaxBitrate(){
return Application_Model_Preference::GetValue("max_bitrate");
}
}

View file

@ -2,7 +2,7 @@
$s_name = "s".$this->stream_number;
?>
<h3 class="collapsible-header"><span class="arrow-icon"></span>Stream <?php echo $this->stream_number?></h3>
<div class="collapsible-content" id="<?=$s_name?>-config" style="display: block;">
<div class="collapsible-content" id="<?=$s_name?>-config" style="display: none;">
<fieldset class="padded">
<dl class="zend_form clearfix">
<dt id="<?=$s_name?>Enabled-label">