0

I am making an app in Unity for android which plays a whole bunch of videos.

Since the apk would be too big if all videos were added at build time, I download the videos at runtime and store them using: Application.persistentDataPath + "/"+filename+".mp4";

The problem is that I am playing the videos inside unity but some devices do not support this functionality (API too low or GPU doesn't support a specific openGL extension), so in those cases my fallback solution is to use androids native player by calling: Handheld.PlayFullScreenMovie(path)

Unfortunately, the videos are stored without world-readable access and therefore the native player is not able to play the downloaded videos.

So my question is, is there a way to make these file world-readable using the path currently used? If not, is there a reliable location where I can store these files where the native player will have access to them regardless of android device?

kUr4m4
  • 659
  • 2
  • 10
  • 24
  • I can't comment on Unity but in Android you need to store your files in a path which is accessible from other applications: the external storage: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal – Carsten Dec 19 '14 at 14:07
  • Yes I am aware of that, unfortunately there is no access inside unity to the method: `Environment.getExternalStoragePublicDirectory()` – kUr4m4 Dec 19 '14 at 14:15
  • looks like persistentDataPath is the correct choice but you also need WRITE_EXTERNAL_STORAGE permissions – Carsten Dec 19 '14 at 14:23
  • I have added a WRITE_EXTERNAL_STORAGE permission into the manifest but the file still doesn't have world readable permission :/ – kUr4m4 Dec 19 '14 at 15:50

0 Answers0