neekeetab / CachingPlayerItem

Play and cache media content simultaneously on your iOS device
MIT License
520 stars 89 forks source link

Issue in downloading. #19

Open anshulkumar189 opened 5 years ago

anshulkumar189 commented 5 years ago

Without start AVPlayer downloading never start. I want to download media(audio/video) without play.

neekeetab commented 5 years ago

You can predownload the file by instantiating CachingPlayerItem and triggering download() method on it. Don't add it to a player until you want to play it, otherwise it will start downloading implicitly. It's a temporary limitation because of a bug that I'm working on.

martaGonz commented 4 years ago

I have an issue in downloading too . The delegates function never gets called and the file is not downloaded and I see an error message

 let item = CachingPlayerItem(url: myUrl)
 item.delegate = self
 item.download()

2020-01-26 15:51:03.191911+0100 Yoy[59293:5915628] Task <6BD1F283-2BAF-4A0B-8ACC-E9F7220441E5>.<1> HTTP load failed, 0/0 bytes (error code: -999 [1:89])