vdugnist / DVAssetLoaderDelegate

Loader delegate for caching AVURLAsset
MIT License
105 stars 28 forks source link

is Disk cache available ? #3

Closed SureshSc closed 5 years ago

SureshSc commented 6 years ago

I wanted to save the cache to disk(Document directory) and when want to play the same url it should take from disk and then should play.

My scenarios:

I wanted to download 3sec of video and should save in cache, when user click play in AVPlayer, disk cached (3sec) video should play first and the remaining video should play from network.

shashank-rps commented 6 years ago

@SureshSc Did you manage to achieve this functionality?

SureshSc commented 6 years ago

@shashank-rps not yet.

vdugnist commented 5 years ago

@SureshSc sorry for late response. To achieve this I can add data source method to loader delegate that can return NSData for requested URL and range. But if you want instantaneous start you should also give resource loader content-type, content length, and byteRangeAccessSupported flag.

Have you thought about caching first seconds with AVPlayer and holding AVAsset objects in memory?

vdugnist commented 5 years ago

will track progress in this issue