[英]Videoportal PWA (Progressive Web App) Video offline function?
We want to build a Videoportal as a PWA.我们想将 Videoportal 构建为 PWA。 Every video will have a watch offline feature.
每个视频都有离线观看功能。 Can this be done via the Serviceworker caching?
这可以通过 Serviceworker 缓存来完成吗? Or should another Download-Mechanism enable this Feature.
或者另一个下载机制是否应该启用此功能。 The videos size is about 120mb.
视频大小约为 120mb。 Target Device is Android and Web.(Sorry for bad english)
目标设备是 Android 和 Web。(抱歉英语不好)
Yes, you can use the Cache Storage API along with service workers to handle offline video playback.是的,您可以将缓存存储 API 与服务工作者一起使用来处理离线视频播放。
There's a complete sample app at https://github.com/googlearchive/sample-media-pwa . https://github.com/googlearchive/sample-media-pwa 上有一个完整的示例应用程序。
If you were to use the Workbox libraries for handling your caching logic, then this guidance should help .如果您要使用 Workbox 库来处理缓存逻辑,那么本指南应该会有所帮助。 If you don't end up using Workbox, then you'll need to implement some logic to handle
Range:
requests in your service worker, or else your video playback will likely not behave as expected when the <video>
element tries to load a partial chunk of video bytes.如果你最终没有使用 Workbox,那么你需要实现一些逻辑来处理
Range:
服务工作者中的请求,否则当<video>
元素尝试加载一个部分视频字节块。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.