SAAS-66: Ability to set the stream values from the command line
- done - extra fix: Fixed a javascript issue when it always changed bitrate to 48, when type is set to ogg
This commit is contained in:
parent
68f142470a
commit
8e283c9e02
|
@ -50,6 +50,13 @@ class Application_Model_StreamSetting {
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* function that take all the information of stream and sets them.
|
||||||
|
* This is used by stream setting via UI.
|
||||||
|
*
|
||||||
|
* @param $data - array that contains all the data. $data is [][] which
|
||||||
|
* contains multiple stream information
|
||||||
|
*/
|
||||||
public static function setStreamSetting($data){
|
public static function setStreamSetting($data){
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
foreach($data as $key=>$d){
|
foreach($data as $key=>$d){
|
||||||
|
@ -76,6 +83,20 @@ class Application_Model_StreamSetting {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sets indivisual stream setting.
|
||||||
|
*
|
||||||
|
* $data - data array. $data is [].
|
||||||
|
*/
|
||||||
|
public static function setIndivisualStreamSetting($data){
|
||||||
|
global $CC_DBC;
|
||||||
|
|
||||||
|
foreach($data as $keyname => $v){
|
||||||
|
$sql = "UPDATE cc_stream_setting SET value='$v' WHERE keyname='$keyname'";
|
||||||
|
$CC_DBC->query($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function setLiquidsoapError($stream_id, $msg){
|
public static function setLiquidsoapError($stream_id, $msg){
|
||||||
global $CC_DBC;
|
global $CC_DBC;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,9 @@ function rebuildStreamURL(ele){
|
||||||
function restrictOggBitrate(ele, on){
|
function restrictOggBitrate(ele, on){
|
||||||
var div = ele.closest("div")
|
var div = ele.closest("div")
|
||||||
if(on){
|
if(on){
|
||||||
div.find("select[id$=data-bitrate]").find("option[value='48']").attr('selected','selected');
|
if(parseInt(div.find("select[id$=data-bitrate]").val(),10) < 48){
|
||||||
|
div.find("select[id$=data-bitrate]").find("option[value='48']").attr("selected","selected");
|
||||||
|
}
|
||||||
div.find("select[id$=data-bitrate]").find("option[value='24']").attr("disabled","disabled");
|
div.find("select[id$=data-bitrate]").find("option[value='24']").attr("disabled","disabled");
|
||||||
div.find("select[id$=data-bitrate]").find("option[value='32']").attr("disabled","disabled");
|
div.find("select[id$=data-bitrate]").find("option[value='32']").attr("disabled","disabled");
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in New Issue