CC-2724: Play Stream Icon + jPlayer popup styling
-#of streams and stream bitrates now fetched from database.
This commit is contained in:
parent
fef0392e43
commit
3dbedc3a56
|
@ -1,7 +1,43 @@
|
||||||
<?php
|
<?php
|
||||||
class Application_Model_StreamSetting {
|
class Application_Model_StreamSetting {
|
||||||
public function __construct(){
|
|
||||||
|
/* 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(){
|
||||||
|
global $CC_DBC;
|
||||||
|
$sql = "SELECT * "
|
||||||
|
."FROM cc_stream_setting "
|
||||||
|
."WHERE keyname LIKE '%_output' "
|
||||||
|
."AND value != 'disabled'";
|
||||||
|
|
||||||
|
$rows = $CC_DBC->getAll($sql);
|
||||||
|
$ids = array();
|
||||||
|
|
||||||
|
foreach ($rows as $row){
|
||||||
|
$ids[] = substr($row["keyname"], 0, strpos($row["keyname"], "_"));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Logging::log(print_r($ids, true));
|
||||||
|
|
||||||
|
return $ids;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Returns all information related to a specific stream. An example
|
||||||
|
* of a stream id is 's1' or 's2'. */
|
||||||
|
public static function getStreamData($p_streamId){
|
||||||
|
global $CC_DBC;
|
||||||
|
$sql = "SELECT * "
|
||||||
|
."FROM cc_stream_setting "
|
||||||
|
."WHERE keyname LIKE '${p_streamId}_%'";
|
||||||
|
|
||||||
|
$rows = $CC_DBC->getAll($sql);
|
||||||
|
$data = array();
|
||||||
|
|
||||||
|
foreach($rows as $row){
|
||||||
|
$data[$row["keyname"]] = $row["value"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getStreamSetting(){
|
public static function getStreamSetting(){
|
||||||
|
@ -12,6 +48,7 @@ class Application_Model_StreamSetting {
|
||||||
$rows = $CC_DBC->getAll($sql);
|
$rows = $CC_DBC->getAll($sql);
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
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){
|
||||||
|
@ -37,4 +74,4 @@ class Application_Model_StreamSetting {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,21 +15,24 @@ $(document).ready(function(){
|
||||||
supplied: "oga",
|
supplied: "oga",
|
||||||
wmode: "window"
|
wmode: "window"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.bit-rates').click(function(){console.log("click")});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<div class="jp-logo"></div>
|
<div class="jp-logo"></div>
|
||||||
<div class="jp-stream">
|
<div class="jp-stream">
|
||||||
<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 $ids = Application_Model_StreamSetting::getEnabledStreamIds();
|
||||||
|
foreach($ids as $id):
|
||||||
|
$streamData = Application_Model_StreamSetting::getStreamData($id);
|
||||||
|
Logging::log("id: ".print_r($streamData, true));
|
||||||
|
?>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="select-stream" value="radio" id="select-stream_0" checked="checked" />
|
<input class='bit-rates' type="radio" name="select-stream" value="radio" id="select-stream_<?php echo $id ?>" checked="checked" />
|
||||||
48 Kbit/s</label>
|
<?php echo "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]; ?> Kbit/s)</label>
|
||||||
<label>
|
<?php endforeach; ?>
|
||||||
<input type="radio" name="select-stream" value="radio" id="select-stream_1" />
|
|
||||||
96 Kbit/s</label>
|
|
||||||
<label>
|
|
||||||
<input type="radio" name="select-stream" value="radio" id="select-stream_2" />
|
|
||||||
192 Kbit/s</label>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
<div id="jquery_jplayer_1" class="jp-jplayer"></div>
|
||||||
|
|
Loading…
Reference in New Issue