On Wed, Dec 26, 2012 at 2:47 PM, <[email protected]> wrote:
> So i am trying to develop a app and i need to get every single song that the
> user has and how often they listen to each one and other sorts of statistics,
> but mainly just get the songs into my app. I am using the B2G extension for
> Firefox Browser. How can i do that?
You can use the DeviceStorage API [1] to get the "music" folder and
enumerate all the files in that folder.
The resulting code would look something like:
var music = navigator.getDeviceStorage("music");
var musicBlobs = [];
var enum = music.enumerate();
enum.onsuccess = function(e) {
blob = enum.result;
if (!blob) {
return; // done enumerating
}
musicBlobs.push(blob);
enum.continue();
}
[1] https://wiki.mozilla.org/WebAPI/DeviceStorageAPI
/ Jonas
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g