移动网络应用和离线访问音频文件 [英] Mobile web app and offline access to audio files

查看:148
本文介绍了移动网络应用和离线访问音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用HTML5缓存清单在移动Web应用程序中缓存音频文件以进行离线访问?
我也不明白尺寸限制是如何工作的。 (我读了iOS的5MB限制)
我找不到资源或最佳实践。

Is it possible to cache audio files for an offline access in a mobile web app using an HTML5 cache manifest ? I also don't understand how size limitations works. (I read 5MB limit for iOS) I don't find resources for that or best practices.

感谢您的帮助

推荐答案

是的 - 浏览器会缓存AppCache中列出的所有文件,无论它们是HTML文件,JavaScript还是音频文件。只要在CACHE部分中明确提到它们,它们就可以离线使用。

Yep - all files that are listed in the AppCache are cached by the browser, no matter if they're HTML files, JavaScript, or audio files. As long as they're explictly mentioned in the CACHE section, they'll be available offline.

要获得一个好的AppCache教程,请查看 http://www.html5rocks.com/en/tutorials/appcache/beginner/ ,引导您完成你应该需要的一切。

For a good AppCache tutorial, check out http://www.html5rocks.com/en/tutorials/appcache/beginner/, which walks you through everything you should need.

大小限制可以防止你在用户计算机上存储太多内容。在大多数情况下,如果您只是存储HTML,CSS,JavaScript和一些图像,这不是问题,但在您的情况下,如果您要存储音乐,您可能会很快达到这个限制。大多数浏览器限制您存储最多5兆(对于所有内容),因此您需要注意这一点。

The size limit prevents you from storing too much content on a users computer. In most cases, this isn't a problem if you're just storing HTML, CSS, JavaScript and some images, but in your case, if you're storing music, you potentially will hit that limit quickly. Most browsers limit you to storing a maximum of 5 megs (for all content), so you'll need to be mindful of that.

Chrome有一套很棒的工具在调试appcache时,在开发站点时,打开开发人员工具并观察控制台,看看会发生什么。

Chrome has a great set of tools for debugging appcache, as you're developing your site, open the Developer Tools and watch the console to see what happens.

这篇关于移动网络应用和离线访问音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆