Re:Show HN: Simple access to your music from the web
by IWantToRelocate on Monday October 18, 2021 @07:23PM
(#28913113)
question: is it possible to cache the music locally somehow so you download/stream the track only once?
[ Parent
| on HN ]
Re:Show HN: Simple access to your music from the web
by soruly on Tuesday October 19, 2021 @12:14AM
(#28914804)
The simpliest way is to play (stream) the music file using <audio> tag, the resource would be cached once you have completed the playback once. Then you can go offline and start looping.
Re:Show HN: Simple access to your music from the web
by codefined on Monday October 18, 2021 @07:29PM
(#28913169)
I think you could use the CacheStorage[0] framework for this, but IIRC it's not got a great size per domain and is limited by a varying amount of 5MB to 100MB depending on browser.
[0] https://developer.mozilla.org/en-US/docs/Web/API/CacheStorag...
Re:Show HN: Simple access to your music from the web
by mynameisash on Monday October 18, 2021 @08:17PM
(#28913514)
It looks like Firefox may be different in this regard. Chrome[0] and Edge[1] allow `unlimitedStorage` to be specified that removes the 5MB default limit.
[0] https://developer.chrome.com/docs/extensions/reference/stora...
[1] https://docs.microsoft.com/en-us/microsoft-edge/extensions-c...