We want to build a Videoportal as a PWA. Every video will have a watch offline feature. Can this be done via the Serviceworker caching? Or should another Download-Mechanism enable this Feature. The videos size is about 120mb. Target Device is Android and Web.(Sorry for bad english)
Yes, you can use the Cache Storage API along with service workers to handle offline video playback.
There's a complete sample app at 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. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With