sintonia/airtime_mvc/public/js/airtime/library/preview_jplayer.js
Daniel 709e117f41 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.
2012-03-06 13:50:07 -05:00

35 lines
769 B
JavaScript

$(document).ready(function(){
var fileID = $(".fileID").text();
play(fileID);
});
function play(fileID){
var uri = "/api/get-media/fileID/" + fileID;
var ext = getFileExt(fileID);
var media;
var supplied;
if (ext == "ogg"){
media = {oga:uri};
supplied = "oga";
} else {
media = {mp3:uri};
supplied = "mp3";
}
$("#jquery_jplayer_1").jPlayer("destroy");
$.jPlayer.timeFormat.showHour = true;
$("#jquery_jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", media).jPlayer("play");
},
swfPath: "/js/jplayer",
cssSelectorAncestor: '#jp_container_1',
wmode: "window"
});
}