First of all, i would like to thank you for the information you have provided me thus far, at least you put me on the right direction , however i got an error after correcting my code…
Here is what i have in Unity
///////////////////////////////////////
var url = “http://domain/Movie/TestingMovie.mov”;
www = new WWW(url);
var progress1 = www;
print(progress1.progress);
while (!progress1.isDone)
yield;
var fileName : String = Application.persistentDataPath + “/” + “TestingMovie.mov”;
print(" progress1.bytes.length = "+progress1.bytes.length);
System.IO.File.WriteAllBytes(fileName, progress1.bytes);
Debug.Log("Cache saved: " + fileName);
print(“file download is done”);
yield WaitForEndOfFrame();
if (System.IO.File.Exists(“file://” + Application.persistentDataPath + “/TestingMovie.mov”))
{
print(" file does exist");
}
else
print(" file does not exist");
iPhoneUtils.PlayMovieURL((“file://” + Application.persistentDataPath + “TestingMovie.mov”), Color.black, iPhoneMovieControlMode.Full);
This is what i have output in Xcode
///////////////////////////////////////////////////
(Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/…/Runtime/Export/Generated/BaseClass.cpp Line: 2505)
progress1.bytes.length = 63708
(Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/…/Runtime/Export/Generated/BaseClass.cpp Line: 2505)
Cache saved: /var/mobile/Applications/BAD0E1A0-FD53-4033-915B-D99C718173B3/Documents/TestingMovie.mov
(Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/…/Runtime/Export/Generated/BaseClass.cpp Line: 2505)
file download is done
(Filename: /Applications/buildAgent/work/6bc5f79e0a4296d6/Projects/…/Runtime/Export/Generated/BaseClass.cpp Line: 2505)
file does not exist
////////////////////////////////////////////////
Not sure what’s going on, even though the correct bytes.length is showing, then i ask it to write all bytes to the file name, but still the files does not exist, thus it does not play!
Something i am missing ?