shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
236 stars 63 forks source link

Allow simultaneous downloads #169

Open OmarPedraza opened 4 years ago

OmarPedraza commented 4 years ago

Hi there, Our app allows users to create a queue with a maximum of 30 videos and, for not overcharging the device, just some of them (three at this moment) are simultaneously downloaded.

I already asked you in #148 how to do this and you suggested me to create different ShakaPlayerStorage objects for each download I want to launch simultaneously.

Trying to follow that workaround, I realized that it requires to create an instance of ShakaPlayerStorage for each element queued, adding too much complexity to the app since it has to manage persistence (something already done in your side), launch multiple list methods for getting all downloaded content,...

Do you have this feature in your roadmap? Any other idea about how to manage this?

joeyparrish commented 4 years ago

Simultaneous downloads in a single Storage instance are supported in Shaka Player since v3.0.0. @TheModMaker, aside from an upgrade to v3, are there additional restrictions in place at the C++ level that would prevent this from working?

TheModMaker commented 4 years ago

I don't know of anything that would prevent that. Also note that you shouldn't need to do anything special to handle multiple storage instances; they share the stored data. So calling list on one will still return the values from the other. You could just create a new storage instance for any operation and destroy it when you're done. The only complexity is that you need to keep the Objective-C/Swift object alive so it isn't destroyed early.