Replies: 4 comments
-
This project is using https://www.npmjs.com/package/@helia/verified-fetch under the hood. @lhns if you had issues with streaming big files, that is a bug. Mind providing a steps to reproduce? |
Beta Was this translation helpful? Give feedback.
-
@lhns it sounds like streaming isn't necessarily broken for you, but the way verified-fetch has to be used doesn't work for streaming because you can't pass the response to How would you be using the service worker in your application? We have discussed creating a workbox plugin that would make it easier for devs to add the service-worker-gateway to their applications, would that work for you? |
Beta Was this translation helpful? Give feedback.
-
Yes this is correct! I think a workbox plugin would be a nice approach. My use case is pretty much as you described it. I want to use ipfs urls as the source of media elements like video and audio but by using this approch it could be applied to any asset of a web application using the standard fetch api. |
Beta Was this translation helpful? Give feedback.
-
@lhns You can try out loading Big Buck Bunny with the Service Worker Gateway: You could potentially embed this as an iframe, but it's not ideal having a new origin with its own service worker for each CID you load. A Workbox plugin is something we want to explore (but have no timeline currently), as it gives you full control over the SW lifecycle and doesn't require a new origin for each CID. (I've converted this into a discussion as it's not really a bug) |
Beta Was this translation helpful? Give feedback.
-
I find this project very fascinating because it really opens up IPFS for real-world use.
I've played around with helia-verified-fetch and it works pretty well but it cannot be used with stuff like media elements containing big media files which have to be streamed.
A service worker like this one would make it possible.
If it was easy to integrate the ServiceWorker into other projects which might not be hosted on IPFS it could be used to load media files like images, audio or videos from IPFS in a streaming fashion.
Beta Was this translation helpful? Give feedback.
All reactions