Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Videoportal PWA (Progressive Web App) Video offline function?

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)

like image 330
oll Avatar asked Jun 01 '17 09:06

oll


Video Answer


1 Answers

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.

like image 198
Jeff Posnick Avatar answered Nov 04 '22 15:11

Jeff Posnick