kean / Nuke

Image loading system
https://kean.blog/nuke
MIT License
8.09k stars 526 forks source link

Add dataTask that is similar to imageTask #784

Open larryonoff opened 4 months ago

larryonoff commented 4 months ago

Hello!

Our application currently uses Nuke for image and video caching.

We want to add video streaming capabilities (video files are relatively small). We've implemented a solution that uses ImageTask.previews with a custom video decoder, which always decode partially downloaded. This solution uses ImageTask.previews.

However, I believe it would be better to have a dedicated feature similar to ImageTask.previews, like DataTask and DataTask.partialData, which would handle and report partially downloaded data along with its response.

Let me know if there's anything more specific you need help with!

kean commented 4 months ago

Hey,

We want to add video streaming capabilities (video files are relatively small). We've implemented a solution that uses ImageTask.previews with a custom video decoder, which always decode partially downloaded. This solution uses ImageTask.previews.

It is a perfectly acceptable solution. ImageResponse is designed to hold data, and it is used this way in other scenarios as well, for example, for rendering animated images.

However, I believe it would be better to have a dedicated feature similar to ImageTask.previews, like DataTask and DataTask.partialData,

I considered this, but the public API in Nuke is already so large that I decided to keep the data support to the bare minimum, intentionally so.

larryonoff commented 4 months ago

I considered this, but the public API in Nuke is already so large that I decided to keep the data support to the bare minimum, intentionally so.

Ideally, it would be great if your library supported video streaming and large videos. :D