Closed gazialankus closed 7 years ago
@gazialankus you're right, caching is not currently available. For most apps, this is definitely the correct behavior. For example, on Facebook, Instagram, Pinterest, or even most YouTube sessions - it's unlikely enough for a user to come back to watch a previous video that it is likely a waste of space. However, caching one video up to a maximum of ~50MB, maybe 500MB for a very video-heavy app, could make sense if the user wants to come back and resume a current video.
Because of this highly app-dependent need, I'm not sure that video caching will be implemented by the core ASDK team in the near future. We are definitely interested to ensure that it is possible for a developer to do this, though. @Eke or @lappp9 might have some thoughts on the right API override points to make this possible. Ironically, since it now descends from ASNetworkImageNode, we might be able to plug into the downloader API (or use it for inspiration) to create a Video downloader / data source API.
@gazialankus: I invited you to our AsyncDisplayKit Slack community. There's a fairly active #asVideoNode channel on there with whom you could discuss this idea.
@hannahmbanana could you please add me as well?
Send us an email / see task #1582 (IIRC)
On Jul 12, 2016, at 4:43 PM, Juan-Carlos Foust notifications@github.com wrote:
@hannahmbanana https://github.com/hannahmbanana could you please add me as well?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/AsyncDisplayKit/issues/1738#issuecomment-232214613, or mute the thread https://github.com/notifications/unsubscribe/AAigA0_ClXm1QwdylJ0NIiYpq311Y97Tks5qVCa0gaJpZM4IyyQy.
I'm going to close this out as it seems like the discussion moved to slack.
As I understand, ASVIdeoNode does not currently cache videos. So, the next time you open the app and watch the same video, you download the video again.
I know It's kind of difficult to cache videos with AVPlayer. Here are some examples for mp3s and AVPlayer: http://stackoverflow.com/a/23754994/679553 http://www.codeproject.com/Articles/875105/Audio-streaming-and-caching-in-iOS-using
Basically your URLs contain a custom protocol instead of http://, and you register a provider that handles that protocol. That provider does the downloading and caching.
It would be great if this was implemented here for videos.