EasyMovieTexture: is possible to load movie files from Application.persistentDataPath ?

Is this possible at all?

I’d assume so but I can’t get any videos from the persistent data path to playback on Android.

I am basically doing the following:

  1. download an mp4 from the inter webs.

  2. save it to internal storage, like so:

    byte[] data = // data that I just downloaded...;
    

    string fileName = “video.mp4”;
    string path = Application.persistentDataPath + “/videos/” + fileName;
    File.WriteAllBytes (path, data);

The above means in android I end up with a full path like:

/data/user/0/com.myCompany.myApp/files/videos/video.mp4

Then I try to load the video with EasyMovieTexture, like so:

    scrMedia.Load (path);
    scrMedia.m_bLoop = true;
    scrMedia.Play ();

But the video does not load.

if instead I directly put the video in StreamingAssets before building, the above code loads the video just fine. So I assume it is either an Android path issue or an EasyMovieTexture issue (i.e. it only loads from StreamingAssets folder). But I’m not sure as of now.

Anyone has any clues?

Thanks!

Amateur mistake… I had forgotten the file:// prefix when specifying paths in Android.

scrMedia.Load ("file://" + path);