问题
how can i download mp3 files locally and then play them using a html5 player , the files should be there even user quit the browser or even come back after couple of days.
回答1:
HTML5 introduced the manifest attribute to the HTML element, which lets you specify a manifest of files to cache locally. All of the examples I saw cache only HTML, CSS, and JS pages, but you could experiment with caching other types of data.
For more information, see:
http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/ http://www.w3.org/TR/html5/offline.html
回答2:
From what I understand Application Cache is something that is controlled strictly by the manifest file rather than by API. Consequently it renders this feature useless to implement caching of files that you serve on demand such as pdf, mp3, mp4 files.
If anyone can point to some docs that show how to store binary data (essentially this is how you can think of the served resources) on the local device please share the info.
来源:https://stackoverflow.com/questions/6215000/how-to-save-files-locally-using-html5