CC-2438: Add a button to listen to the stream immediately

-Streams selectable by their description
-Repeatedly clicking on the ON-AIR, focus()es the window
 instead of reloading it.
This commit is contained in:
martin 2011-09-30 12:58:49 -04:00
parent 0613c6db3a
commit a31920e982
2 changed files with 6 additions and 3 deletions

View File

@ -56,7 +56,7 @@ $(document).ready(function(){
if ($type == "ogg") if ($type == "ogg")
$type = "oga"; $type = "oga";
$label = "Stream ".substr($id, 1)." (".$streamData["${id}_bitrate"]." Kbit/s)"; $label = $streamData["${id}_description"]." (".$streamData["${id}_bitrate"]." Kbit/s)";
echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s'>%s</option>", $id, $url, $type, $label); echo sprintf("<option class='stream' value='%s' data-url='%s' data-type='%s'>%s</option>", $id, $url, $type, $label);
} }
?> ?>

View File

@ -249,6 +249,8 @@ function setupQtip(){
} }
} }
var stream_window = null;
function init() { function init() {
//begin producer "thread" //begin producer "thread"
getScheduleFromServer(); getScheduleFromServer();
@ -259,8 +261,9 @@ function init() {
setupQtip(); setupQtip();
$('#on-air-info').click(function() { $('#on-air-info').click(function() {
newwindow=window.open("/Dashboard/stream-player", 'name', 'width=400,height=216'); if (stream_window == null || stream_window.closed)
if (window.focus) {newwindow.focus()} stream_window=window.open("/Dashboard/stream-player", 'name', 'width=400,height=216');
stream_window.focus();
return false; return false;
}); });
} }