Background Fetch - HTTP 203
Вставка
- Опубліковано 23 сер 2024
- Jake shows Surma an actual thing he built using a new web API - Background Fetch.
Here's the app: bgfetch-http20...
More details on the podcast: developers.goo...
More info on Background Fetch: developers.goo...
Animation worklets: developers.goo...
Listening to you two is too much fun.
Thanks. Keep it up guys.
Excellent use case & demo.
Can't wait to see the backgroundUpload.
Great humor guys! And the topic is excellent web API )
Great walkthrough and example using the slow and fast networks. Thanks and keep these coming!
If the user never return the website they have to clear their entire history in order to reclaim storage? I feel that it is the browser responsibility to have a storage management area. I know that you can’t sorta see it in a berried tab somewhere, but I think it should put the user more in control like the “installed apps” or “add or remove programs” on windows, instead of just clearing stuff automatically based on heuristics once every page on the web starts to claim hundreds of mb. When persistent storage starts to mean “sorta persistent” then we are back to putting everything on the servers.
I hope we get to a point where installed sites are managed in the same place as installed native apps.
My mind just get blown
I'm trying to do something similar so this is really helpful!
Not directly related to the video, but I think this question might be in the same ballpark. Are there plans to make it possible to have audio persist after a website is closed or navigated away from as well? Obviously you wouldn't want it used by websites maliciously, but using media sessions or picture in picture might be enough to make the user aware of where the sound is coming from. Even if it only persisted when the user stayed in the same domain I think it would be pretty useful. For instance, if your application had a second page when the users navigates to it, it looks like the audio would just cut off (or at least pause for a second until you could recreate the audio element).
I guess making it a SPA is the obvious solution, but it would be cool if it was possible without that in the future!
Edit: Now that I think about it, perhaps portals can be used for seamless audio once they're released (as long as you remain on the same domain of course).
The only solution I'm aware of is to create a new window to handle the playback and control of the audio/video
Seriously awesome. can't wait to test it out in Polymer :)
Podgressive web app.... Do I win?
Everyone who reads this comment loses.
Very cool feature and nice video! Keep it up :)
hilarious aggressive chuckles
Nice video, as it supported in chrome now so I am trying to implement the same but it's chasing the browser without any error, and I am not able to catch the progress event. please anyone can let me know the reason for this.
Thanks
Why not just start with a HEAD fetch first to try to determine the value of downloadTotal? Not every server supports it but most do and, as long as it is a static file or dynamic with Content-Length support, you should be able to get the size of the file that you want to attempt to download.
Things like movies tend to be chunked into 1000s of files. In that case, the amount of time it would take for those requests becomes a huge problem.
Can you add more items to an existing background fetch after it has already been initiated? Like if the user taps on another episode to download?
The current API doesn't allow this. You'd need to start a new background fetch, either immediately or once the current one finishes. In terms of user experience, I think it's better to start separate background fetches for seperate things the user can interact with. As in, 5 podcasts should be 5 background fetches, 5 movies should be 5 background fetches. This means, clicking an individual notification has a more obvious action, and completion can be per-episode.
awesome. thanks for this!
Happy new year!! xD
I don't think service workers will run if browser is closed completely, may be browser runs in the background
It works even if you properly close the browser! If something like background fetch download finishes, the app (which is either Chrome or the WebAPK) receives an intent (I believe), which can then spin up the ServiceWorker and dispatch the event.
@@bhavesh9702 Not quite sure what you mean. Do you mean if you reboot the device while the download is still on-going? Then I’m not sure at all. Once the download is finished, it’s up to the ServiceWorker to cache the files and then, yes, they would survive a download.
@@bhavesh9702 if you put it in some kind of persistant storage, yes. :D
There's something wrong with the sample. It seems stuck on a continuous loop of downloading the resources.
I really like the app, I wanted this on there tho!
Is this pwa open source? Also it doesn't show any episodes on iOS.
7:45 There's a Promise joke in there somewhere.
So service worker runs without a browser.please reply.its a js file
When is fuchsia os released?
2:34 Was that a sheldon cooper🤔
cool feature
Awesome
Jake, stop trying to make fetch happen! It's not going to happen! :)
Chrome, Please make it so I can play roblox on my chrome book laptop if u can I really want to play it. I’m starting to regret getting my chrome book laptop. I can’t do anything on my chrome book laptop except for searching and stuff I can’t do anything! I’m regretting to buy my laptop.
Instead of calling it transfer, use move. At least then it will fall into the Linux naming paradigm.