Merge branch 'master' of dev.sourcefabric.org:campcaster

This commit is contained in:
Naomi 2011-01-28 17:37:55 -05:00
commit 38b01ea43f
5 changed files with 40 additions and 6 deletions

View File

@ -13,7 +13,7 @@ $pages = array(
'module' => 'Nowplaying',
'controller' => 'index',
'action' => 'index',
'order' => -100 // make sure home is the first page
'order' => -100 //make sure home is the first page
),
array(
'label' => 'Schedule',

View File

@ -12,7 +12,7 @@ class LoginController extends Zend_Controller_Action
{
if(Zend_Auth::getInstance()->hasIdentity())
{
$this->_redirect('library/index');
$this->_redirect('Nowplaying');
}
//uses separate layout without a navigation.
@ -50,7 +50,7 @@ class LoginController extends Zend_Controller_Action
$authStorage = $auth->getStorage();
$authStorage->write($userInfo);
$this->_redirect('library/index');
$this->_redirect('Nowplaying');
}
else
{

View File

@ -3,7 +3,7 @@
<?php endif; ?>
<li class="ui-state-default" id="spl_<?php echo $this->partialCounter-1 ?>">
<a href="#" class="big_play"><span class="ui-icon ui-icon-play"></span></a>
<a href="javascript:void(0);" class="big_play" onclick="audioPreview('spl_<?php echo $this->partialCounter-1 ?>', '/api/get-media/file/<?php echo $this->CcFiles["gunid"] ?>.mp3/api_key/AAA')"><span class="ui-icon ui-icon-play"></span></a>
<div class="text-row top">
<span class="spl_playlength"><?php echo $this->cliplength ?></span>
<span class="spl_title"><?php echo $this->CcFiles['track_title'] ?></span>

View File

@ -95,4 +95,38 @@ function convertDateToPosixTime(s){
}
return Date.UTC(year, month, day, hour, minute, sec, msec);
}
}
/* This function decides whether a song should be played or stopped.
* It decides the current state of music through the presence/absence
* of the <audio> tag. It also takes care of the managing the play/pause
* icons of the buttons. */
function audioPreview(e, uri){
var elems = $('.ui-icon.ui-icon-pause');
elems.attr("class", "ui-icon ui-icon-play");
var s = $('#'+e);
var spl = $('#side_playlist');
if (spl.children('audio').length != 1){
spl.append('<audio autoplay="autoplay"></audio>');
//spl.children('audio').attr('autoplay', 'autoplay');
spl.children('audio').attr('src', uri);
var arr = $(s).children("a").children().attr("class", "ui-icon ui-icon-pause");
var myAudio = spl.children('audio')[0];
var canPlayMp3 = !!myAudio.canPlayType && "" != myAudio.canPlayType('audio/mpeg');
var canPlayOgg = !!myAudio.canPlayType && "" != myAudio.canPlayType('audio/ogg; codecs="vorbis"');
alert(canPlayMp3);
alert(canPlayOgg);
} else {
if (spl.children('audio').attr('data-playlist-id') == $(s).attr("id")){
spl.children("audio").remove();
} else {
spl.children('audio').attr('autoplay', 'autoplay');
spl.children('audio').attr('src', uri);
spl.children('audio').attr('data-playlist-id', $(s).attr("id"));
$(s).children("a").children().attr("class", "ui-icon ui-icon-pause");
}
}
}

View File

@ -52,7 +52,7 @@ function createDataGrid(){
datagridData.columnHeaders[3]["fnRender"] = getTimeText;
datagridData.columnHeaders[4]["fnRender"] = changeTimePrecisionInit;
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" width="100%" id="nowplayingtable"></table>' );
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="datatable" width="100%" id="nowplayingtable"></table>' );
$('#nowplayingtable').dataTable( {
"bSort" : false,
"bJQueryUI": true,