Hey y’all.
I’m doing a project using movie textures, which is mostly done. However, one of the requirements is that the user must be able to have a folder to set his own videos to be loaded by the application.
I already managed to load videos at runtime using WWW class.
IEnumerator Start () {
//Debug.Log(Application.dataPath);
//Debug.Log(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments));
movie = renderer.material.mainTexture as MovieTexture;
string path = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments), "cat.ogv");
// www = new WWW ("file://c://cat.ogv"); <-- works
www = new WWW("file://c://Program Files (x86)/cat.ogv"); //<-- won't work
while(!www.movie.isReadyToPlay){
yield return www;
}
movie = www.movie;
renderer.material.mainTexture = movie;
}
Problem is that I tried setting manually a folder on My Documents. It won’t work.
Then I tried setting a folder on the built project. Won’t work.
I’ve been searching for quite some time (hence the commented Application stuff) but couldn’t quite figure out why it won’t load the file. I imagine it is a permission thing(?), because it will load files on C: and public users folders, but not anything beyond.
*edited the code to better explain the issue