CC-2430: Preview tracks in the library + better preview (ability to jump around in clip)

- Merged with devel, removed js from StoredFile.php
This commit is contained in:
Daniel 2012-03-02 17:55:17 -05:00
parent 51f004933b
commit a246f85a5b
6 changed files with 570 additions and 1151 deletions

View File

@ -68,7 +68,7 @@ class LibraryController extends Zend_Controller_Action
public function contextMenuAction() public function contextMenuAction()
{ {
global $CC_CONFIG; global $CC_CONFIG;
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$type = $this->_getParam('type'); $type = $this->_getParam('type');
@ -88,15 +88,17 @@ class LibraryController extends Zend_Controller_Action
if (isset($this->pl_sess->id) && $screen == "playlist") { if (isset($this->pl_sess->id) && $screen == "playlist") {
$menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "copy"); $menu["pl_add"] = array("name"=> "Add to Playlist", "icon" => "copy");
} }
//Open a jPlayer window and play the audio clip.
$menu["play"] = array("name"=> "Play", "icon" => "big_play");
$menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}"); $menu["edit"] = array("name"=> "Edit Metadata", "icon" => "edit", "url" => "/library/edit-file-md/id/{$id}");
if ($user->isAdmin()) { if ($user->isAdmin()) {
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete"); $menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/library/delete");
} }
$url = $file->getRelativeFileUrl($baseUrl).'/download/true'; $url = $file->getRelativeFileUrl($baseUrl).'/download/true';
$menu["download"] = array("name" => "Download", "url" => $url); $menu["download"] = array("name" => "Download", "url" => $url);
if (Application_Model_Preference::GetUploadToSoundcloudOption()) { if (Application_Model_Preference::GetUploadToSoundcloudOption()) {

View File

@ -660,10 +660,8 @@ Logging::log("getting media! - 2");
//access to zend view methods to access url helpers is needed. //access to zend view methods to access url helpers is needed.
if($type == "au" && isset( $audioResults )) { if($type == "au" && isset( $audioResults )) {
$audioFile = $audioResults[$row['id']-1]['gunid'].".".pathinfo($audioResults[$row['id']-1]['filepath'], PATHINFO_EXTENSION); $row['audioFile'] = $audioResults[$row['id']-1]['gunid'].".".pathinfo($audioResults[$row['id']-1]['filepath'], PATHINFO_EXTENSION);
$row['image'] = '<a href="javascript:void(0);" class="big_play" $row['image'] = '<span class="ui-icon ui-icon-play"></span>';
onclick="open_audio_preview(\''.$audioFile.'\', \'spl_'.$row['id'].'\');">
<span class="ui-icon ui-icon-play"></span></a>';
} }
else { else {

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
var audio_preview_window = null; var audio_preview_window_p = null;
function playlistAudioPreviewEditor(filename, elemIndexString){ function playlistAudioPreviewEditor(filename, elemIndexString){
@ -41,7 +41,7 @@ function playlistAudioPreviewEditor(filename, elemIndexString){
} }
function open_audio_preview(filename, index) { function open_audio_preview_old(filename, index) {
console.log("hello world 2 "+filename+" help?"); console.log("hello world 2 "+filename+" help?");
url = 'Playlist/audio-preview-player/filename/'+filename+'/index/'+index; url = 'Playlist/audio-preview-player/filename/'+filename+'/index/'+index;
//$.post(baseUri+'Playlist/audio-preview-player', {fileName: fileName, cueIn: cueIn, cueOut: cueOut, fadeIn: fadeIn, fadeInFileName: fadeInFileName, fadeOut: fadeOut, fadeOutFileName: fadeOutFileName}) //$.post(baseUri+'Playlist/audio-preview-player', {fileName: fileName, cueIn: cueIn, cueOut: cueOut, fadeIn: fadeIn, fadeInFileName: fadeInFileName, fadeOut: fadeOut, fadeOutFileName: fadeOutFileName})
@ -57,6 +57,13 @@ function open_audio_preview(filename, index) {
console.log("something else : "+baseUrl+url); console.log("something else : "+baseUrl+url);
} }
audio_preview_window.focus(); //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; return false;
} }
$('#library_type').bind('click', function(){
console.log(data);
});

View File

@ -67,6 +67,6 @@ function play(filename){
cssSelectorAncestor: '#jp_container_1', cssSelectorAncestor: '#jp_container_1',
wmode: "window" wmode: "window"
}); });
$this.focus();
} }

File diff suppressed because one or more lines are too long