from what I understand, Unity is placed in the background and stops running when you call iPhoneUtils.PlayMovie as it uses the movie player built into the iphone/ipod. when the movie finishes, unity picks up where it left off.
so It’ll just be the next call to the update function after a “playmovie” call?
in that case, there’s any way to know if the user has cancelled the playback by pressing the touch or if he watched all the movie?
for the second question: i don’t believe so. i suppose you can kinda fudge it by getting Time.time before you play the movie and then again afterwards. if the difference between the two calls to Time.time are equal to the length of the movie then they watched the whole thing. if its less, that means they interrupted it.
I’m refreshing this topic, because I haven’t found solution yet. Information from Unity documentation isn’t helpful because it’s simply not true… or there’s a bug, or I am doing something wrong.
I want to play intro at the very beginning. Here’s my code:
Unity loads next scene (which simply shows splash screen), then loads another one and then finally plays movie. Moving PlayMovie() from Start() to Update() doesn’t help either.
function Update() {
if ((iPhoneInput.touchCount > 0 || Input.GetMouseButtonDown(0) == true) go == false) {
// Es gibt eine Toucheingabe
go = true;
startVideo();
}
}
function startVideo() {
iPhoneUtils.PlayMovie(“themovie.m4v”, Color.black, iPhoneMovieControlMode.CancelOnTouch);
Application.LoadLevel (“start”);
}
works just fine. level seems to be loaded after movie quits.
in case this doesnt work for you try writing yield new WaitForSeconds(3); after the playmovie command
that would be useful if i pressed the home button and get back to my game , in this case i need entire frame or the current second to know what i will load or wait while im finish playing video !!!