minht11 / local-music-pwa

Lightweight on device music player PWA.
https://snaeplayer.com/
MIT License
154 stars 20 forks source link

Just some questions #23

Closed Nicknaem closed 1 year ago

Nicknaem commented 1 year ago

hi, first of all I want to say big thanks to you for making such simple cool music player, its awesome. I always wanted to make my music player pwa so I got some questions to you

isn't it possible for pwa's to save imported tracks somehow so I don't have to import them every time I open the player? the only way to bypass importing all music by hand is to choose a fixed folder and import all tracks automatically on startup? it wont be comfortable because it takes time for importing bunch of music.

how do you read music tags? probably with music-metadata package yup? that package says its metadata parser for node.js, how is there node.js involved in pwa? I thought node server was just for dev purposes, does any server run when I launch snaeplayer?

can you edit id3 tags of music? I think would need some other package for that

minht11 commented 1 year ago

isn't it possible for pwa's to save imported tracks somehow so I don't have to import them every time I open the player?

After importing tracks once, they should be saved inside browser storage, so even page refresh data is still available. That does sound like a bug. What browser and OS are you using? Maybe one of extensions are interfering?

how do you read music tags? probably with music-metadata package yup? that package says its metadata parser for node.js, how is there node.js involved in pwa? I thought node server was just for dev purposes, does any server run when I launch snaeplayer?

For parsing metadata we indeed use music-metadata package, just because it is written for node doesn't mean it can't run in the browser. There is no server, it's just javascript. However there is a catch some apis like nodeJS buffer needed to be polyfilled for it to work. It all depends on what apis library uses. There is work being done inside music-metadata so in the future even that might not be needed https://github.com/minht11/local-music-pwa/blob/349f3352a1e92224cb479e910e7d03773ab5c859/src/helpers/tracks-file-parser/worker/tracks-file-parser-worker.ts#L9-L11

can you edit id3 tags of music? I think would need some other package for that

As far as I know music-metadata doesn't support tag editing by itself so yes some other package would be needed.

Nicknaem commented 1 year ago

thanks a lot for response I tested it on safari ios 15, on windows 10 and on android firefox browser, when I shut down app and reopen it again, imported tracks aren't saved

minht11 commented 1 year ago

Sorry about that, previous update indeed broke track persistence behaviour. It should be fixed now https://github.com/minht11/local-music-pwa/pull/26

Nicknaem commented 1 year ago

image am I missing something or pwa on safari supports direct access to files? will it be possible not to duplicate files in indexedDb and use them directly on iphone?

minht11 commented 1 year ago

Safari and soon Firefox, supports The File System Access API with Origin Private File System. It does not however support access to native file system, so for now answer is no.