Search Unity

Making file world-readable in Unity android

Discussion in 'Android' started by Castiel412, Dec 19, 2014.

  1. Castiel412

    Castiel412

    Joined:
    Dec 8, 2014
    Posts:
    7
    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:
    Code (CSharp):
    1. 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:
    Code (CSharp):
    1. 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?