如何在 HTML5 的应用程序缓存中存储 50MB 的视频?

发布于 2025-01-01 16:13:51 字数 255 浏览 2 评论 0原文

我正在开发一个 iOS 离线应用程序,我正在尝试存储一个 50MB 的视频以供离线观看。但是,在我的 manifest.appcache 中正确添加视频的 url 后,我收到控制台错误,指出应用程序缓存限制超出了允许的大小。因此,破坏了我的整个页面;之后没有加载任何资源。

一旦我从应用程序缓存中取消链接视频,一切都会正常。

有什么办法可以规避这种行为吗?或者,有没有办法可以在 IOS5+ iPad 上存储 50MB 视频以供离线观看?

I'm developing an iOS offline app, and i'm trying to store a 50MB video for offline viewing. However after properly adding the video's url in my manifest.appcache, I got a console Error saying that the appcache limit exceeded the allowed size. Therefore, breaks my whole page; not one resource is loaded after.

As soon as I unlink the video from the appcache, everything works fine.

Is there a way i can circumvent this behavior ? Or, is there a way i can store a 50MB video on an IOS5+ iPad for offline view ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

飞烟轻若梦 2025-01-08 16:13:51

您必须要求用户在 iOS 设置中增加限制。查看《金融时报》网络应用程序并了解他们的方法。

http://apps.ft.com/ftwebapp/

让用户做的事情不是很优雅手动,但由于没有 API,所以没有真正的替代方案(除了 PhoneGap 等)。

You have to ask the user to increase the limit in the iOS settings. Check out the financial times web app and see their approach.

http://apps.ft.com/ftwebapp/

It's not very elegant to get the user to do it manually, but since there's no API, there's no real alternative (except PhoneGap, etc.).

我一直都在从未离去 2025-01-08 16:13:51

可能无法存储您的 50MB 视频。 iOS 目前的限制似乎是 5mb。

根据这个答案类似的问题,可以通过一些技巧来提出它,但这可能不是您视频的选择。

也许您可以包含视频的(真正)低分辨率版本,甚至可以是较小的尺寸以供离线观看。

There is probably no way to store your 50MB video. The current limit on iOS seems to be 5mb.

According to this answer to a similar question it's possible to raise it with some trickery, but that's probably not an option for your video.

Maybe you can include a (really) low res version of your video, maybe even in a smaller size for offline viewing.

江湖正好 2025-01-08 16:13:51

根据您的浏览器要求,您可能会发现 IndexDB 作为存储文件以供离线访问的可能解决方案。 IndexDB 旨在存储比本地存储更多的数据。

演示:在 IndexDB 中存储图像和文件

Depending on your browser requirements you may find IndexDB as a possible solution to store files for offline access. IndexDB was designed to store larger amounts of data than localstorage.

Demo: Storing Images and files in IndexDB

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文