Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
f75cf5ffe2
|
@ -24,15 +24,22 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$audioFileID = $this->_getParam('audioFileID');
|
||||
$audioFileArtist = $this->_getParam('audioFileArtist');
|
||||
$audioFileTitle = $this->_getParam('audioFileTitle');
|
||||
$type = $this->_getParam('type');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
|
||||
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],
|
||||
'text/javascript');
|
||||
$this->view->headScript()->appendFile(
|
||||
$baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],
|
||||
'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet(
|
||||
$baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->_helper->layout->setLayout('audioPlayer');
|
||||
|
||||
$logo = Application_Model_Preference::GetStationLogo();
|
||||
|
@ -41,6 +48,17 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
} else {
|
||||
$this->view->logo = "$baseUrl/css/images/airtime_logo_jp.png";
|
||||
}
|
||||
|
||||
if ($type == "audioclip") {
|
||||
$uri = "/api/get-media/file/".$audioFileID;
|
||||
} else if ($type == "stream") {
|
||||
$webstream = CcWebstreamQuery::create()->findPk($audioFileID);
|
||||
$uri = $webstream->getDbUrl();
|
||||
} else {
|
||||
throw new Exception("Unknown type for audio preview!");
|
||||
}
|
||||
|
||||
$this->view->uri = $uri;
|
||||
$this->view->audioFileID = $audioFileID;
|
||||
$this->view->audioFileArtist = $audioFileArtist;
|
||||
$this->view->audioFileTitle = $audioFileTitle;
|
||||
|
@ -83,49 +101,49 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
|
||||
public function blockPreviewAction()
|
||||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$blockIndex = $this->_getParam('blockIndex');
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->_helper->layout->setLayout('audioPlayer');
|
||||
|
||||
$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->blockIndex= $blockIndex;
|
||||
$this->view->blockId = $blockId;
|
||||
|
||||
global $CC_CONFIG;
|
||||
|
||||
$blockIndex = $this->_getParam('blockIndex');
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
$baseDir = dirname($_SERVER['SCRIPT_FILENAME']);
|
||||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/audiopreview/preview_jplayer.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/jplayer/jplayer.playlist.min.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
$this->view->headLink()->appendStylesheet($baseUrl.'/js/jplayer/skin/jplayer.airtime.audio.preview.css?'.$CC_CONFIG['airtime_version']);
|
||||
$this->_helper->layout->setLayout('audioPlayer');
|
||||
|
||||
$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->blockIndex= $blockIndex;
|
||||
$this->view->blockId = $blockId;
|
||||
|
||||
$this->_helper->viewRenderer->setRender('audio-preview');
|
||||
}
|
||||
public function getBlockAction()
|
||||
{
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
||||
if (!isset($blockId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// disable the view and the layout
|
||||
$this->view->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$blockId = $this->_getParam('blockId');
|
||||
|
||||
if (!isset($blockId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$bl = new Application_Model_Block($blockId);
|
||||
$result = array();
|
||||
$result = array();
|
||||
foreach ($bl->getContents(true) as $ele) {
|
||||
$result[] = $this->createElementMap($ele);
|
||||
}
|
||||
}
|
||||
$this->_helper->json($result);
|
||||
}
|
||||
/**
|
||||
|
@ -155,26 +173,40 @@ class AudiopreviewController extends Zend_Controller_Action
|
|||
$result[] = $this->createElementMap($track);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
$result[] = $this->createElementMap($ele);
|
||||
}
|
||||
}
|
||||
$this->_helper->json($result);
|
||||
}
|
||||
|
||||
function createElementMap($track){
|
||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||
'element_id' => isset($track['id'])?$track['id']:"",
|
||||
'element_position' => isset($track['position'])?$track['position']:"",
|
||||
);
|
||||
$fileExtension = pathinfo($track['path'], PATHINFO_EXTENSION);
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} else if (strtolower($fileExtension) === 'ogg') {
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
private function createElementMap($track)
|
||||
{
|
||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||
'element_id' => isset($track['id'])?$track['id']:"",
|
||||
'element_position' => isset($track['position'])?$track['position']:"",
|
||||
);
|
||||
|
||||
|
||||
$elementMap['type'] = $track['type'];
|
||||
|
||||
if ($track['type'] == 0) {
|
||||
$fileExtension = pathinfo($track['path'], PATHINFO_EXTENSION);
|
||||
//type is file
|
||||
//TODO: use MIME type for this
|
||||
if (strtolower($fileExtension) === 'mp3') {
|
||||
$elementMap['element_mp3'] = $track['item_id'];
|
||||
} else if (strtolower($fileExtension) === 'ogg') {
|
||||
$elementMap['element_oga'] = $track['item_id'];
|
||||
} else {
|
||||
//the media was neither mp3 or ogg
|
||||
throw new Exception("Unknown file type");
|
||||
}
|
||||
|
||||
$elementMap['uri'] = "/api/get-media/file/".$track['item_id'];
|
||||
} else {
|
||||
$elementMap['uri'] = $track['path'];
|
||||
}
|
||||
return $elementMap;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($this->obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
} else {
|
||||
} else if ($this->obj_sess->type === "block") {
|
||||
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
}
|
||||
}
|
||||
|
@ -101,8 +101,6 @@ class LibraryController extends Zend_Controller_Action
|
|||
if ($isAdminOrPM || $obj->getCreatorId() == $user->getId()) {
|
||||
if ($this->obj_sess->type === "playlist") {
|
||||
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
} else {
|
||||
$menu["pl_add"] = array("name"=> "Add to Smart Playlist", "icon" => "add-playlist", "icon" => "copy");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +179,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
try {
|
||||
Application_Model_Block::deleteBlocks($blocks, $user->getId());
|
||||
} catch (Exception $e) {
|
||||
//TODO: warn user that not all blocks could be deleted.
|
||||
//TODO: warn user that not all blocks could be deleted.
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -153,8 +153,8 @@ class PlaylistController extends Zend_Controller_Action
|
|||
Logging::log("{$e->getMessage()}");
|
||||
}
|
||||
|
||||
private function playlistDenied($obj) {
|
||||
$this->view->error = "You cannot add playlists to smart playlists.";
|
||||
private function wrongTypeToBlock($obj) {
|
||||
$this->view->error = "You can only add tracks to smart playlists.";
|
||||
$this->createFullResponse($obj);
|
||||
}
|
||||
|
||||
|
@ -315,13 +315,15 @@ class PlaylistController extends Zend_Controller_Action
|
|||
// if the dest is a block object
|
||||
//check if any items are playlists
|
||||
foreach($ids as $id) {
|
||||
if (is_array($id) && isset($id[1]) && $id[1] == 'playlist') {
|
||||
throw new Exception('playlist to block');
|
||||
if (is_array($id) && isset($id[1])) {
|
||||
if ($id[1] != 'audioclip') {
|
||||
throw new WrongTypeToBlockException;
|
||||
}
|
||||
}
|
||||
}
|
||||
$obj->addAudioClips($ids, $afterItem, $addType);
|
||||
} else {
|
||||
throw new Exception('track to dynamic');
|
||||
throw new BlockDynamicException;
|
||||
}
|
||||
$this->createUpdateResponse($obj);
|
||||
}
|
||||
|
@ -331,14 +333,14 @@ class PlaylistController extends Zend_Controller_Action
|
|||
catch (PlaylistNotFoundException $e) {
|
||||
$this->playlistNotFound($obj_type);
|
||||
}
|
||||
catch (WrongTypeToBlockException $e) {
|
||||
$this->wrongTypeToBlock($obj);
|
||||
}
|
||||
catch (BlockDynamicException $e) {
|
||||
$this->blockDynamic($obj);
|
||||
}
|
||||
catch (Exception $e) {
|
||||
if ($e->getMessage() == 'playlist to block') {
|
||||
$this->playlistDenied($obj);
|
||||
} else if ($e->getMessage() == 'track to dynamic') {
|
||||
$this->blockDynamic($obj);
|
||||
} else {
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
$this->playlistUnknownError($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,5 +608,6 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
die(json_encode($out));
|
||||
}
|
||||
|
||||
}
|
||||
class WrongTypeToBlockException extends Exception {}
|
||||
class BlockDynamicException extends Exception {}
|
||||
|
|
|
@ -196,7 +196,8 @@ class Application_Model_Block
|
|||
f.id as item_id, f.track_title, f.artist_name as creator, f.file_exists as exists, f.filepath as path FROM cc_blockcontents AS pc
|
||||
LEFT JOIN cc_files AS f ON pc.file_id=f.id
|
||||
LEFT JOIN cc_block AS bl ON pc.block_id = bl.id
|
||||
WHERE pc.block_id = {$this->id};
|
||||
WHERE pc.block_id = {$this->id}
|
||||
ORDER BY pc.position;
|
||||
EOT;
|
||||
$con = Propel::getConnection();
|
||||
$rows = $con->query($sql)->fetchAll();
|
||||
|
@ -882,6 +883,7 @@ EOT;
|
|||
public function deleteAllFilesFromBlock()
|
||||
{
|
||||
CcBlockcontentsQuery::create()->findByDbBlockId($this->id)->delete();
|
||||
$this->block->reload();
|
||||
}
|
||||
|
||||
// smart block functions start
|
||||
|
@ -943,7 +945,7 @@ EOT;
|
|||
$error[] = "Limit cannot be empty or smaller than 0";
|
||||
} else {
|
||||
$mins = $data['etc']['sp_limit_value'] * $multiplier;
|
||||
if ($mins > 14400) {
|
||||
if ($mins > 1440) {
|
||||
$error[] = "Limit cannot be more than 24 hrs";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -641,6 +641,11 @@ class Application_Model_StoredFile
|
|||
$blSelect[] = "NULL::int AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "NULL::int AS ".$key;
|
||||
} else if ($key === "filepath") {
|
||||
$plSelect[] = "NULL::VARCHAR AS ".$key;
|
||||
$blSelect[] = "NULL::VARCHAR AS ".$key;
|
||||
$fileSelect[] = $key;
|
||||
$streamSelect[] = "url AS ".$key;
|
||||
} else {
|
||||
$plSelect[] = "NULL::text AS ".$key;
|
||||
$blSelect[] = "NULL::text AS ".$key;
|
||||
|
@ -719,13 +724,13 @@ class Application_Model_StoredFile
|
|||
//datatable stuff really needs to be pulled out and generalized within the project
|
||||
//access to zend view methods to access url helpers is needed.
|
||||
|
||||
Logging::log($type);
|
||||
if ($type == "au") {
|
||||
$row['audioFile'] = $row['id'].".".pathinfo($row['filepath'], PATHINFO_EXTENSION);
|
||||
$row['image'] = '<img title="Track preview" src="/css/images/icon_audioclip.png">';
|
||||
} else if ($type == "pl") {
|
||||
$row['image'] = '<img title="Playlist preview" src="/css/images/icon_playlist.png">';
|
||||
} else if ($type == "st") {
|
||||
$row['audioFile'] = $row['id'];
|
||||
$row['image'] = '<img title="Webstream preview" src="/css/images/record_icon.png">';
|
||||
} else if ($type == "bl") {
|
||||
$row['image'] = '<img title="Smart Playlist" src="/css/images/delete.png">';
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<?php elseif (isset($this->blockId)): ?>
|
||||
<span class='blockId'><?php echo "$this->blockId" ?></span>
|
||||
<span class='blockIndex'><?php echo "$this->blockIndex" ?></span>
|
||||
<?php elseif (isset($this->audioFileID)): ?>
|
||||
<span class='audioFileID'><?php echo "$this->audioFileID" ?></span>
|
||||
<?php elseif (isset($this->uri)): ?>
|
||||
<span class='audioUri'><?php echo "$this->uri" ?></span>
|
||||
<span class='audioFileTitle'><?php echo "$this->audioFileTitle" ?></span>
|
||||
<span class='audioFileArtist'><?php echo "$this->audioFileArtist" ?></span>
|
||||
<?php elseif (isset($this->showID)): ?>
|
||||
|
|
|
@ -19,10 +19,10 @@ if (isset($this->obj)) {
|
|||
<input id="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id='obj_type' type='hidden' value='playlist'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="spl_name">
|
||||
<h3 id="obj_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
</h3>
|
||||
<h4 id="spl_length"><?php echo $this->length; ?></h4>
|
||||
<h4 id="obj_length"><?php echo $this->length; ?></h4>
|
||||
</div>
|
||||
<div id='sp-success' class='success' style='display:none'></div>
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ if (isset($this->obj)) {
|
|||
<input id="obj_lastMod" type="hidden" value="<?php echo $this->obj->getLastModified('U'); ?>"></input>
|
||||
<input id='obj_type' type='hidden' value='block'></input>
|
||||
<div class="playlist_title">
|
||||
<h3 id="bl_name">
|
||||
<h3 id="obj_name">
|
||||
<a id="playlist_name_display" contenteditable="true"><?php echo $this->obj->getName(); ?></a>
|
||||
</h3>
|
||||
<h4 id="bl_length"><?php echo $this->length; ?></h4>
|
||||
<h4 id="obj_length"><?php echo $this->length; ?></h4>
|
||||
</div>
|
||||
|
||||
<fieldset class="toggle closed" id="fieldset-metadate_change">
|
||||
|
|
|
@ -35,7 +35,8 @@ $(document).ready(function(){
|
|||
|
||||
$.jPlayer.timeFormat.showHour = true;
|
||||
|
||||
var audioFileID = $('.audioFileID').text();
|
||||
var audioUri = $('.audioUri').text();
|
||||
//var audioFileID = $('.audioFileID').text();
|
||||
var playlistID = $('.playlistID').text();
|
||||
var playlistIndex = $('.playlistIndex').text();
|
||||
var showID = $('.showID').text();
|
||||
|
@ -47,8 +48,8 @@ $(document).ready(function(){
|
|||
|
||||
if (playlistID != "" && playlistID !== ""){
|
||||
playAllPlaylist(playlistID, playlistIndex);
|
||||
}else if (audioFileID != "") {
|
||||
playOne(audioFileID);
|
||||
}else if (audioUri != "") {
|
||||
playOne(audioUri);
|
||||
}else if (showID != "") {
|
||||
playAllShow(showID, showIndex);
|
||||
}else if(blockId != "" && blockIndex != ""){
|
||||
|
@ -75,7 +76,7 @@ function playAllPlaylist(p_playlistID, p_playlistIndex) {
|
|||
|
||||
if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) {
|
||||
play(p_playlistIndex);
|
||||
}else {
|
||||
} else {
|
||||
buildplaylist("/audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +87,7 @@ function playBlock(p_blockId, p_blockIndex)
|
|||
|
||||
if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) {
|
||||
play(p_blockIndex);
|
||||
}else {
|
||||
} else {
|
||||
buildplaylist("/audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
|
||||
}
|
||||
}
|
||||
|
@ -123,20 +124,28 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
var index;
|
||||
var total = 0;
|
||||
for(index in data){
|
||||
|
||||
if (data[index]['element_mp3'] != undefined){
|
||||
media = {title: data[index]['element_title'],
|
||||
|
||||
if (data[index]['type'] == 0) {
|
||||
if (data[index]['element_mp3'] != undefined){
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
mp3:data[index]['uri']
|
||||
};
|
||||
} else if (data[index]['element_oga'] != undefined) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
oga:data[index]['uri']
|
||||
};
|
||||
}
|
||||
} else if (data[index]['type'] == 1) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
mp3:"/api/get-media/file/"+data[index]['element_mp3']
|
||||
};
|
||||
}else if (data[index]['element_oga'] != undefined) {
|
||||
media = {title: data[index]['element_title'],
|
||||
artist: data[index]['element_artist'],
|
||||
oga:"/api/get-media/file/"+data[index]['element_oga']
|
||||
mp3:data[index]['uri']
|
||||
};
|
||||
}
|
||||
myPlaylist[index] = media;
|
||||
|
||||
if (media) {
|
||||
myPlaylist[index] = media;
|
||||
}
|
||||
// we should create a map according to the new position in the player itself
|
||||
// total is the index on the player
|
||||
_idToPostionLookUp[data[index]['element_id']] = total;
|
||||
|
@ -179,18 +188,18 @@ function play(p_playlistIndex){
|
|||
* Playing one audio track occurs from the library. This function will create the media, setup
|
||||
* jplayer and play the track.
|
||||
*/
|
||||
function playOne(p_audioFileID) {
|
||||
function playOne(uri) {
|
||||
var playlist = new Array();
|
||||
var fileExtension = p_audioFileID.split('.').pop();
|
||||
var fileExtension = uri.split('.').pop();
|
||||
if (fileExtension.toLowerCase() === 'mp3') {
|
||||
media = {title: $('.audioFileTitle').text() !== 'null' ?$('.audioFileTitle').text():"",
|
||||
artist: $('.audioFileArtist').text() !== 'null' ?$('.audioFileArtist').text():"",
|
||||
mp3:"/api/get-media/file/"+p_audioFileID
|
||||
mp3:uri
|
||||
};
|
||||
}else if (fileExtension.toLowerCase() === 'ogg' ) {
|
||||
} else if (fileExtension.toLowerCase() === 'ogg' ) {
|
||||
media = {title: $('.audioFileTitle').text() != 'null' ?$('.audioFileTitle').text():"",
|
||||
artist: $('.audioFileArtist').text() != 'null' ?$('.audioFileArtist').text():"",
|
||||
oga:"/api/get-media/file/"+p_audioFileID
|
||||
oga:uri
|
||||
};
|
||||
}
|
||||
_playlist_jplayer.option("autoPlay", true);
|
||||
|
|
|
@ -43,15 +43,18 @@ function openAudioPreview(p_event) {
|
|||
}
|
||||
}
|
||||
|
||||
function open_audio_preview(audioFileID, audioFileTitle, audioFileArtist) {
|
||||
function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
|
||||
// we need to remove soundcloud icon from audioFileTitle
|
||||
var index = audioFileTitle.indexOf("<span class=");
|
||||
if(index != -1){
|
||||
audioFileTitle = audioFileTitle.substring(0,index);
|
||||
}
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+audioFileID+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle);
|
||||
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+audioFileArtist+'/audioFileTitle/'+audioFileTitle+'/type/'+type);
|
||||
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
*Opens a jPlayer window for the specified info, for either an audio file or playlist.
|
||||
*If audioFile, audioFileTitle, audioFileArtist is supplied the jplayer opens for one file
|
||||
|
@ -96,12 +99,7 @@ function open_show_preview(p_showID, p_showIndex) {
|
|||
}
|
||||
|
||||
function openPreviewWindow(url) {
|
||||
|
||||
//$.post(baseUri+'Playlist/audio-preview-player', {fileName: fileName, cueIn: cueIn, cueOut: cueOut, fadeIn: fadeIn, fadeInFileName: fadeInFileName, fadeOut: fadeOut, fadeOutFileName: fadeOutFileName})
|
||||
_preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
|
||||
//Set the play button to pause.
|
||||
//var elemID = "spl_"+elemIndexString;
|
||||
//$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -423,7 +423,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (aData.ftype === 'audioclip') {
|
||||
open_audio_preview(aData.audioFile, aData.track_title, aData.artist_name);
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
} else if (aData.ftype == 'stream') {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
@ -637,7 +639,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
playlistIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (data.ftype === 'audioclip') {
|
||||
open_audio_preview(data.audioFile, data.track_title, data.artist_name);
|
||||
open_audio_preview(data.ftype, data.audioFile, data.track_title, data.artist_name);
|
||||
} else if (data.ftype === 'block') {
|
||||
blockIndex = $(this).parent().attr('id').substring(3); //remove the pl_
|
||||
open_block_preview(blockIndex, 0);
|
||||
|
|
|
@ -296,7 +296,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$('#spl_name > a')
|
||||
.empty()
|
||||
.append(json.name);
|
||||
$('#spl_length')
|
||||
$('#obj_length')
|
||||
.empty()
|
||||
.append(json.length);
|
||||
$('#fieldset-metadate_change textarea')
|
||||
|
|
Loading…
Reference in New Issue