How to include large resources with my iOS application

Question

I am developing an iOS application where a requirement is for the user to view a known set of videos locally and without streaming. Because the videos do not live on a server of any kind on the internet, the files must be included with the app when installed.

The application will not be distributed on the app store, and will probably be distributed by some enterprise means (Airwatch, Apperian, etc). I am not yet sure which.

I am currently storing the videos under the app bundle's resources. I do not think this is sustainable because the size of all the videos will eventually be too large (we are thinking 10s of gigs).

What should I do?

Posted Apr 22, 2017, 3:06 PM UTC

418
Power781•

you do not have a choice, either you download it, either it's in the bundle

6
_cortex•

Because the videos do not live on a server of any kind on the internet, the files must be included with the app when installed.

I am currently storing the videos under the app bundle's resources.

What should I do?

I think you've answered your own question there.

6
desleeOP•

I don't get it, can you explain? As I said the videos will eventually be larger than the bundle size limit.

1
_cortex•

You said the reason the videos have to be on the device is because they are not stored on a server on the internet. Store them on a server on the internet, and your problem will be solved.

AFAIK the bundle size limit is only valid for the App Store, enterprise apps can be as large as you want.

If you really cannot store them in the app or on the internet, setting up a local server and streaming from there would work as well.

3
desleeOP•

Setting up a server is not an option for the near future. I didn't know that the bundle limit is only for app store apps, so the bundle solution works for now. Thanks!

1
devsquid•

Just use one of the many cloud CDNs. Google and Amazon have two great and cheap options.

1
fakecrabs•

Put it in Amazon's S3. It's very easy to setup.

1
sa6ry•

This as you said the storage is not a problem and this is going to be the only app installed on the iPad. then, where is the problem?!

Don't over engineer the problem. bundle's resources do the job. then go for it!!!

Even if the bundle's resources are 10s of gigs, it won't make a performance hit, the resources aren't loaded in the memory with the App!

Don't over think the problem! you already have a working solution without any draw back & the client is happy :)

2
desleeOP•

There is no bundle size limit for apps distributed outside the app store, right? If so then you're right, using the bundle is the best solution.

1
sa6ry•

Yes, there no bundle size limit.

1
20InMyHead•

10s of gigs? Streaming or downloading a subset of videos to watch later is really the only way to go. Nobody will want this one app to take up that much storage on their phone, and installs will take forever. Not to mention all the installs that will just fail for lack of space, or network interruption while downloading for so long.

1
desleeOP•

Well, streaming isn't an option for the client. And the app is going to be the only app pushed to a set of iPad pros in a facility, so storage isn't a problem.

1
20InMyHead•

I guess then if the circumstances are so specialized why do you think keeping them in the app bundle is not sustainable? I would agree it's not sustainable for most apps, but your situation seems to be very specific.

1
desleeOP•

There is no bundle size limit for apps distributed outside the app store, right? If so then you're right, using the bundle is the best solution.

1
fubarx•

There's no free lunch. If they all have to be present you either include it in the bundle or you don't and that means downloading or streaming.

Another option is a sort of hybrid.

Assuming the videos have to be watched in some sort of order you can include #1 in the bundle to let them get going quickly then allow the rest to be downloaded as needed from a server (like Amazon S3) and then watched locally.

You can also do clever things like get them to choose what to watch next and then download in the background while they're watching an already downloaded one.

Might also want to look into Reachability so you can restrict downloads only to when on wifi.

If you want to stream, HTTP Live Streaming (HLS) is the most common way. A bunch of cloud providers out there support it and make it really easy to host the content.

1
desleeOP•

Unfortunately, streaming or hosting the videos online isn't an option for the iPads used in the facility. I'm starting to think the only solution is to have the MDM push the videos to the device's storage and somehow access them from the app. Do you know if that's even possible?

1
venkatg22•

you requirement itself is complicated . like they need not to stream.and they should not have big app size.. contradictry... . one thing from my mind you could do that.. you can keep the videos somewhere in server in shared path..in background you can download and store it in sandbox . based on a priority.....

Thanks, Venkat http://www.programteach.com

1
sneeden•

Are the videos categorized? Perhaps split your app into a group of "flavored" apps? Each with a different subject, icon, and title? Or a table of contents app that launches the other apps?

1