CC-2724: Play Stream Icon + jPlayer popup styling

-changed to use <select> box instead of radio buttons
This commit is contained in:
martin 2011-09-28 16:36:16 -04:00
parent 4f22c5b424
commit 3ded56fdc2
1 changed files with 15 additions and 16 deletions

View File

@ -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>