CC-3391: Audio Preview cannot play tracks with commas in their filename

- The content distribution header filename attribute, wasn't properly quoted for inline content. This causes a bug for files with comma names.
- changed the play button in library back to the speaker icon
- removed some dead code preview_player.js
- removed the file name attribute, will need better approch to presenting the user with audio information.
This commit is contained in:
Daniel 2012-03-06 13:50:07 -05:00
parent 348011dbc3
commit 709e117f41
8 changed files with 22 additions and 67 deletions

View file

@ -1,49 +1,11 @@
function audioPreview(filename, elemID){
console.log("in the audio preview");
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
});
$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
}
$(document).ready(function(){
var filename = $(".filename").text();
var name = $(".name").text();
play(name, filename);
var fileID = $(".fileID").text();
play(fileID);
});
function play(name, filename){
var uri = "/api/get-media/name/"+name+"/filename/" + filename;
var ext = getFileExt(filename);
function play(fileID){
var uri = "/api/get-media/fileID/" + fileID;
var ext = getFileExt(fileID);
var media;