CC-2430: Preview tracks in the library + better preview (ability to jump around in clip)
- updates to audio preview on library and playlist
This commit is contained in:
parent
0b9ed43e50
commit
1aab682104
|
@ -84,10 +84,11 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/playlist.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/playlist.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/dashboard/versiontooltip.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
|
||||||
|
|
||||||
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$view->headScript()->appendFile($baseUrl.'/js/airtime/common/common.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
|
||||||
if (Application_Model_Preference::GetPlanLevel() != "disabled"
|
if (Application_Model_Preference::GetPlanLevel() != "disabled"
|
||||||
&& $_SERVER['REQUEST_URI'] != '/Dashboard/stream-player') {
|
&& ($_SERVER['REQUEST_URI'] != '/Dashboard/stream-player' || $_SERVER['REQUEST_URI'] != '/Playlist/audio-preview-player')) {
|
||||||
$client_id = Application_Model_Preference::GetClientId();
|
$client_id = Application_Model_Preference::GetClientId();
|
||||||
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
|
$view->headScript()->appendScript("var livechat_client_id = '$client_id';");
|
||||||
$view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
$view->headScript()->appendFile($baseUrl . '/js/airtime/common/livechat.js?'.$CC_CONFIG['airtime_version'], 'text/javascript');
|
||||||
|
|
|
@ -15,6 +15,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
->addActionContext('new', 'json')
|
->addActionContext('new', 'json')
|
||||||
->addActionContext('edit', 'json')
|
->addActionContext('edit', 'json')
|
||||||
->addActionContext('delete', 'json')
|
->addActionContext('delete', 'json')
|
||||||
|
->addActionContext('play', 'json')
|
||||||
->addActionContext('set-playlist-fades', 'json')
|
->addActionContext('set-playlist-fades', 'json')
|
||||||
->addActionContext('get-playlist-fades', 'json')
|
->addActionContext('get-playlist-fades', 'json')
|
||||||
->addActionContext('set-playlist-name', 'json')
|
->addActionContext('set-playlist-name', 'json')
|
||||||
|
@ -111,6 +112,7 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$baseUrl = $request->getBaseUrl();
|
$baseUrl = $request->getBaseUrl();
|
||||||
|
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/playlist_jplayer_preview.js?'.filemtime($baseDir.'/js/airtime/library/playlist_jplayer_preview.js'), 'text/javascript');
|
||||||
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
$this->_helper->viewRenderer->setResponseSegment('spl');
|
$this->_helper->viewRenderer->setResponseSegment('spl');
|
||||||
|
@ -194,6 +196,31 @@ class PlaylistController extends Zend_Controller_Action
|
||||||
$this->playlistUnknownError($e);
|
$this->playlistUnknownError($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function audioPreviewPlayerAction()
|
||||||
|
{
|
||||||
|
Logging::log("PlaylistControler::in the play action");
|
||||||
|
|
||||||
|
$fileName = $this->_getParam('elementFilename');
|
||||||
|
$playlistIndex = $this->_getParam('elemIndexString');
|
||||||
|
|
||||||
|
$request = $this->getRequest();
|
||||||
|
$baseUrl = $request->getBaseUrl();
|
||||||
|
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
||||||
|
|
||||||
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/playlist_jplayer_preview.js?'.filemtime($baseDir.'/js/airtime/library/playlist_jplayer_preview.js'),'text/javascript');
|
||||||
|
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.blue.monday.css?'.filemtime($baseDir.'/js/jplayer/skin/jplayer.blue.monday.css'));
|
||||||
|
$this->_helper->layout->setLayout('bare');
|
||||||
|
|
||||||
|
$logo = Application_Model_Preference::GetStationLogo();
|
||||||
|
if($logo){
|
||||||
|
$this->view->logo = "data:image/png;base64,$logo";
|
||||||
|
} else {
|
||||||
|
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
|
||||||
|
}
|
||||||
|
$this->view->fileName = $fileName;
|
||||||
|
$this->view->playlistIndex= $playlistIndex;
|
||||||
|
}
|
||||||
|
|
||||||
public function addItemsAction()
|
public function addItemsAction()
|
||||||
{
|
{
|
||||||
|
|
|
@ -629,9 +629,7 @@ class Application_Model_StoredFile {
|
||||||
|
|
||||||
$results = Application_Model_StoredFile::searchFiles($displayColumns, $fromTable, $datatables);
|
$results = Application_Model_StoredFile::searchFiles($displayColumns, $fromTable, $datatables);
|
||||||
|
|
||||||
|
|
||||||
foreach ($results['aaData'] as &$row) {
|
foreach ($results['aaData'] as &$row) {
|
||||||
|
|
||||||
$row['id'] = intval($row['id']);
|
$row['id'] = intval($row['id']);
|
||||||
|
|
||||||
$formatter = new LengthFormatter($row['length']);
|
$formatter = new LengthFormatter($row['length']);
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
$items = $this->pl->getContents();
|
$items = $this->pl->getContents();
|
||||||
if (count($items)) : ?>
|
if (count($items)) : ?>
|
||||||
|
|
||||||
<?php $i = 0; ?>
|
<?php $i = 0; ?>
|
||||||
<?php foreach($items as $item) : ?>
|
<?php foreach($items as $item) : ?>
|
||||||
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$item["id"]; ?>">
|
<li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$item["id"]; ?>">
|
||||||
<div class="list-item-container">
|
<div class="list-item-container">
|
||||||
<a href="javascript:void(0);" class="big_play"
|
<a href="javascript:void(0);" class="big_play" onClick="open_audio_preview(
|
||||||
accesskey=onClick="playlistAudioPreviewEditor(
|
'<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"],PATHINFO_EXTENSION);?>', '<?php echo $i ?>');">
|
||||||
'<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"],
|
|
||||||
PATHINFO_EXTENSION);?>', '<?php echo $i ?>');">
|
|
||||||
<span class="ui-icon ui-icon-play"></span></a>
|
<span class="ui-icon ui-icon-play"></span></a>
|
||||||
|
|
||||||
<div class="text-row top">
|
<div class="text-row top">
|
||||||
|
|
|
@ -186,88 +186,7 @@ function audioStream(){
|
||||||
swfPath: "/js/jplayer",
|
swfPath: "/js/jplayer",
|
||||||
supplied: supplied
|
supplied: supplied
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function playlistAudioPreviewEditor(filename, elemIndexString){
|
|
||||||
|
|
||||||
elemIndex =parseInt(elemIndexString)+1;//increment the index as tags start from 1 not 0
|
|
||||||
console.log("hello world with index "+elemIndex);
|
|
||||||
|
|
||||||
|
|
||||||
var cueIn = $("dd[id^=spl_cue_in_"+elemIndex+"]").find('span').html();
|
|
||||||
console.log(cueIn);
|
|
||||||
|
|
||||||
var cueOut = $("dd[id^=spl_cue_out_"+elemIndex+"]").find('span').html();
|
|
||||||
console.log("The cueOut is "+cueOut);
|
|
||||||
|
|
||||||
var fadeIn = $("dd[id^=spl_fade_in_"+elemIndex+"]").find('span').html();
|
|
||||||
if (fadeIn == undefined){ console.log("undefined fadein"); fadeIn = $("dd[id^=spl_fade_in_main]").find('span').html();}
|
|
||||||
console.log("The fadeIn is "+fadeIn);
|
|
||||||
|
|
||||||
var fadeInFileName = "";
|
|
||||||
if (fadeIn != undefined && parseInt(fadeIn) > 0 ){
|
|
||||||
//need to get the previous element in the playlist...but don't support previous playlist fading becuase thats not possible.
|
|
||||||
|
|
||||||
}
|
|
||||||
console.log("The fadeInFileName is "+fadeInFileName);
|
|
||||||
|
|
||||||
var fadeOut = $("dd[id^=spl_fade_out_"+elemIndex+"]").find('span').html();
|
|
||||||
if (fadeOut == undefined){ console.log("undefined fadeout"); fadeOut = $("dd[id^=spl_fade_out_main]").find('span').html();}
|
|
||||||
console.log("The fadeOut is "+fadeOut);
|
|
||||||
|
|
||||||
var fadeOutFileName = "";
|
|
||||||
if (fadeOut != undefined && parseInt(fadeOut) > 0 ){
|
|
||||||
//need to get the next element in the playlist...but don't support next playlist fading becuase thats not possible.
|
|
||||||
|
|
||||||
}
|
|
||||||
console.log("The fadeOutFileName is "+fadeOutFileName);
|
|
||||||
|
|
||||||
//Pop out a play list with cue in and cue out set.
|
|
||||||
console.log(baseUrl+"Dashboard/audio-preview-player");
|
|
||||||
//window.open(baseUrl+"Dashboard/audio-preview-player", "music player", "width=200,height=200");
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
//Set the play button to pause.
|
|
||||||
var elemID = "spl_"+elemIndexString;
|
|
||||||
$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function audioPreview(filename, elemID){
|
|
||||||
|
|
||||||
var elems = $('.ui-icon.ui-icon-pause');
|
|
||||||
elems.attr("class", "ui-icon ui-icon-play");
|
|
||||||
|
|
||||||
if ($("#jquery_jplayer_1").data("jPlayer") && $("#jquery_jplayer_1").data("jPlayer").status.paused != true){
|
|
||||||
$('#jquery_jplayer_1').jPlayer('stop');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var ext = getFileExt(filename);
|
|
||||||
var uri = "/api/get-media/file/" + filename;
|
|
||||||
|
|
||||||
var media;
|
|
||||||
var supplied;
|
|
||||||
if (ext == "ogg"){
|
|
||||||
media = {oga:uri};
|
|
||||||
supplied = "oga";
|
|
||||||
} else {
|
|
||||||
media = {mp3:uri};
|
|
||||||
supplied = "mp3";
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#jquery_jplayer_1").jPlayer("destroy");
|
|
||||||
$("#jquery_jplayer_1").jPlayer({
|
|
||||||
ready: function () {
|
|
||||||
$(this).jPlayer("setMedia", media).jPlayer("play");
|
|
||||||
},
|
|
||||||
swfPath: "/js/jplayer",
|
|
||||||
supplied: supplied,
|
|
||||||
wmode:"window"
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
|
|
||||||
}
|
|
||||||
|
|
||||||
function resizeImg(ele, targetWidth, targetHeight){
|
function resizeImg(ele, targetWidth, targetHeight){
|
||||||
var img = $(ele);
|
var img = $(ele);
|
||||||
|
|
Loading…
Reference in New Issue