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...

КОМЕНТАРІ • 37

  • @ParasBansal10
    @ParasBansal10 5 років тому +42

    Listening to you two is too much fun.
    Thanks. Keep it up guys.

  • @DenisTRUFFAUT
    @DenisTRUFFAUT 5 років тому +24

    Excellent use case & demo.
    Can't wait to see the backgroundUpload.

  • @avilde
    @avilde 5 років тому +7

    Great humor guys! And the topic is excellent web API )

  • @hypersonic12
    @hypersonic12 5 років тому

    Great walkthrough and example using the slow and fast networks. Thanks and keep these coming!

  • @victornpb
    @victornpb 5 років тому +7

    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.

    • @jakearchibald
      @jakearchibald 5 років тому +4

      I hope we get to a point where installed sites are managed in the same place as installed native apps.

  • @suman-majhi
    @suman-majhi 3 роки тому +1

    My mind just get blown

  • @jonathanfeldman7309
    @jonathanfeldman7309 5 років тому +1

    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).

    • @jakearchibald
      @jakearchibald 5 років тому

      The only solution I'm aware of is to create a new window to handle the playback and control of the audio/video

  • @camstuart
    @camstuart 5 років тому

    Seriously awesome. can't wait to test it out in Polymer :)

  • @PaulKinlan
    @PaulKinlan 5 років тому +8

    Podgressive web app.... Do I win?

    • @jakearchibald
      @jakearchibald 5 років тому +10

      Everyone who reads this comment loses.

  • @havunen100
    @havunen100 5 років тому

    Very cool feature and nice video! Keep it up :)

  • @lv85huenex
    @lv85huenex 5 років тому +1

    hilarious aggressive chuckles

  • @FunOfHeuristic
    @FunOfHeuristic 4 роки тому

    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

  • @jimbo2150
    @jimbo2150 5 років тому +1

    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.

    • @jakearchibald
      @jakearchibald 5 років тому +2

      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.

  • @adityabhat7358
    @adityabhat7358 5 років тому +1

    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?

    • @jakearchibald
      @jakearchibald 5 років тому +5

      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.

  • @tealiedie
    @tealiedie 5 років тому

    awesome. thanks for this!

  • @carlosnatera2523
    @carlosnatera2523 5 років тому

    Happy new year!! xD

  • @nallamalalokesh2212
    @nallamalalokesh2212 5 років тому +1

    I don't think service workers will run if browser is closed completely, may be browser runs in the background

    • @dassurma
      @dassurma 5 років тому +5

      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.

    • @dassurma
      @dassurma 5 років тому +2

      @@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.

    • @k1ngjulien_
      @k1ngjulien_ 5 років тому +3

      @@bhavesh9702 if you put it in some kind of persistant storage, yes. :D

  • @AdamsTaiwan
    @AdamsTaiwan 5 років тому

    There's something wrong with the sample. It seems stuck on a continuous loop of downloading the resources.

  • @jeremyscheatday7305
    @jeremyscheatday7305 5 років тому

    I really like the app, I wanted this on there tho!

  • @CompTutts
    @CompTutts 5 років тому

    Is this pwa open source? Also it doesn't show any episodes on iOS.

  • @WalterKimaro
    @WalterKimaro 5 років тому

    7:45 There's a Promise joke in there somewhere.

  • @meenakshinegi
    @meenakshinegi 5 років тому

    So service worker runs without a browser.please reply.its a js file

  • @cavendishhenry1562
    @cavendishhenry1562 5 років тому

    When is fuchsia os released?

  • @WalterKimaro
    @WalterKimaro 5 років тому +1

    2:34 Was that a sheldon cooper🤔

  • @heratpatel7174
    @heratpatel7174 5 років тому

    cool feature

  • @rk1only4you1
    @rk1only4you1 5 років тому

    Awesome

  • @protocolus
    @protocolus 5 років тому

    Jake, stop trying to make fetch happen! It's not going to happen! :)

  • @mrderpnoob-de2ob
    @mrderpnoob-de2ob 5 років тому

    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.

  • @Dygear
    @Dygear 5 років тому

    Instead of calling it transfer, use move. At least then it will fall into the Linux naming paradigm.