Simulator of version 2.2+ doesn't discover my music



3 years ago
8 months ago


(Reporter: nazar, Unassigned)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



3 years ago
Firefox OS Simulator of version 2.1- nicely detects all my music from profile's music directory (like ~/Music), but 2.2+ simulator doesn't.

Ubuntu 15.10 x64.
Tried fake-sdcard, doesn't work at all.


3 years ago
OS: Gonk (Firefox OS) → Linux
Hardware: ARM → x86_64


3 years ago
Ever confirmed: true
I checked the nightly b2g desktop build.

2014-12-15 (ver 2.2)[1] : it can search from ~/Music
2014-12-16 (ver 2.2)[2] : it can't search from ~/Music

Created attachment 8644797 [details]

I created minimum test application.

The result of this test application different from 2.1 and 2.2 .

  storage = navigator.getDeviceStorage("music");
  var cursor = storage.enumerate();
  cursor.onsuccess = function() {
    var file = this.result;
[Firefox 2.1 Simulator Result]
File { size: 1120146, type: "audio/mpeg", name: "jazz_03.mp3", path: "", lastModifiedDate: Date 2015-07-28T08:04:36.206Z, mozFullPath: "C:\Users\manta\Music\jazz_03.mp3" }

[Firefox 2.2 Simulator Result]
    at cursor.onsuccess (app://6eeec604-fb5b-48c1-afbd-0849311e3e72/js/app.js:14:4)
Perhaps, this problem was occurred from bug 996619.
After bug 996619, '' is setting Profile's directory.(attachment 8536477 [details] [diff] [review])

So, nsDeviceStorage is overriding a preference value.[1]

However, MDN document wrote as follow.[2]
> Note: this is mostly meant for API testing. Music will be read not from the "fake-sdcard" directory, 
> but from your system's ~/Music, pictures from ~/Pictures, videos from ~/Videos. Downloads go to ~/Downloads.
> user-dirs.dirs redefinitions are supported.

Does this behavior which not reading from user-dirs is correct?
I think that should override directory in case of is true or reference sdcard/apps/crashes directories.
What do you think this behavior?

Flags: needinfo?(janx)
Thank you for investigating this, Mantaroh!

Alex, there might be a music discovery problem with the new way we simulate storage. I don't really like the old way of discoving content (not in fake-sdcard, but in the user's home dir) because it feels weird privacy-wise.

Maybe all simulator content discovery should come from the fake-sdcard? Then we could also modify the MDN entry.
Flags: needinfo?(poirot.alex)
Flags: needinfo?(janx)
My overall plan was to make it so that WebIDE would redirect all simulators it runs to a single, shared, storage directory, used for all the API that are related to storage.

So, the current behavior, if that's really what happens, is expected.
All storages should be map to the `storage` folder, within each simulator profile folder.
This is quite terrible as, unless you find the related MDN page, you don't know about this one.
The discoverability of this is terrible.

Ideally, we would make it clear from WebIDE, that storages are mapped to one directory and easily discover/open it from it. And also, you would be able to change to anything you want.
Flags: needinfo?(poirot.alex)

Comment 6

8 months ago
Firefox OS is not being worked on
Last Resolved: 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.