neekeetab / CachingPlayerItem

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

Is it harmless to call download() many times? #28

Open smhk opened 4 years ago

smhk commented 4 years ago

Say at 11:11:07.0 I call x.download()

Say that will take about three seconds to reach playerItemReadyToPlay and 10 seconds to fully download.

At 11:11:08.0 I call x.download() again

  1. is this completely harmless ?

  2. Does it know it is already doing x ?

thanks! @neekeetab - amazing library, the best

zoink commented 4 years ago

+1

neekeetab commented 4 years ago

Calling download when there’s already a file loading has no effect

zoink commented 4 years ago

If we repeatedly call download on the same item (even if item is being actively downloaded), will the item be downloaded again? Or is there a way we can check if an item has already been downloaded? Thanks.

Sent via Superhuman ( https://sprh.mn/?vip=bryanhpchiang@gmail.com )

On Wed, Jan 08, 2020 at 11:42 PM, Nikita Belousov < notifications@github.com > wrote:

Calling download when there’s already a file loading has no effect

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/neekeetab/CachingPlayerItem/issues/28?email_source=notifications&email_token=ACRBWAPIC7VRWDZCSIUQ6DTQ43INJA5CNFSM4JZC7EGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIPKISY#issuecomment-572433483 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/ACRBWAMTIGZIYL6SMJRM2T3Q43INJANCNFSM4JZC7EGA ).

neekeetab commented 4 years ago

It will not be downloaded again. When loading is complete, delegate's playerItem(_ playerItem: CachingPlayerItem, didFinishDownloadingData data: Data) is called

zoink commented 4 years ago

Great, thanks!

Sent via Superhuman ( https://sprh.mn/?vip=bryanhpchiang@gmail.com )

On Thu, Jan 09, 2020 at 3:53 AM, Nikita Belousov < notifications@github.com > wrote:

It will not be downloaded again. When loading is complete, delegate's playerItem(_ playerItem: CachingPlayerItem, didFinishDownloadingData data: Data) is called

— You are receiving this because you commented. Reply to this email directly, view it on GitHub ( https://github.com/neekeetab/CachingPlayerItem/issues/28?email_source=notifications&email_token=ACRBWAPYRIN4ZUZZBD6LZ23Q44F5NA5CNFSM4JZC7EGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIQBRPQ#issuecomment-572528830 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/ACRBWALAQU36MDAM7ZPSZMDQ44F5NANCNFSM4JZC7EGA ).

auro-krishna commented 4 years ago

Is there any way I can check whether my file is present in the cached list? and also I wanted to clear the memory when total memory consumption is more