I am trying to play an .mp3 file on the server side using ElFinder. I have created two instances of ElFinder. How should I play a file from one of the instances on the server side? Here is the code
handlers : {
select : function(event, elfinderInstance) {
var selected = event.data.selected;
if (selected.length>0) {
var filenamex=elfinderInstance.file(selected[0]).name;
console.log(filenamex);
var path=elfinderInstance.path(selected[0]);
console.log(path);
if(filenamex.indexOf(".mp3") == filenamex.length - 4) {
console.log("Mp3 file");
}
}
}
},
lang : 'en',
customData : {answer : 42},
rememberLastDir :false,
debug:true
}).elfinder('instance');
I first try to check whether the selected file is a mp3 file or not. If it is a mp3 file then I should be able to play it.