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
5 changed files with 32 additions and 90 deletions
|
@ -186,88 +186,7 @@ function audioStream(){
|
|||
swfPath: "/js/jplayer",
|
||||
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){
|
||||
var img = $(ele);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue