1

I am doing a video Library app. I want store 6 videos locally in this app. When user download this app, it already had those 6 videos. Also, those videos might be replaced later by other videos if the app has been updated from server. So where should I put those videos? The sandbox document or other place?

Janice Zhan
  • 571
  • 1
  • 5
  • 18

2 Answers2

1

The pre-uploaded videos will always be in your bundle, you have no method to replace it. All the other videos will be in your sandbox as it's the only place you can use.

You can have a look at on-demand-resource introduced in iOS9, which may be what you want.

user3349433
  • 480
  • 2
  • 11
  • +1 to you for mentioning On-Demand resources. [Here's the WWDC introduction to it](https://developer.apple.com/videos/play/wwdc2015/214/?time=35). However, this may be a little heavy, or hard to pick up and run with for novice iOS developers. – Michael Dautermann Jun 28 '16 at 08:33
  • If I put the initial videos on bundle, I cannot remove it, right? Is there any other way I can try? – Janice Zhan Jun 28 '16 at 09:11
  • Yes, the initial videos will always in the main bundle. If you have investigate the hierarchy of a jailbreak iOS, you will find your sandbox and main bundle are separated. The only place you can operate is the sandbox(including the default one with libraries like Document, also group container or iCloud container if you use them) – user3349433 Jun 29 '16 at 05:29
0

The Documents folder is indeed the best place to store videos or other files that you want to persist between launches of the application.

Because cellular data can be expensive and to reduce initial download size, I recommend allowing the user to download the video files only after installing your app.

The concept I'm talking about can be seen by looking at this related question (code is in Objective-C, tho).

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215