iPhoneUtils.PlayMovie won't pause Unity immediately

Hi,

the function iPhoneUtils.PlayMovie won’t pause Unity3D immediately. It takes a couple of undefined msec until Unity3D relay going into pause. ( see documentation for iPhoneUtils.PlayMovie )

How much time need iPhoneUtils.PlayMovie until Unity3d is goint into pause?

This is important for me to know when i can load the next scene.

Thanks

I was having the same problems you are having today. But after a bit of digging around, I found that this seems to work. This is C# though…not sure how it’s done in Javascript if you use that.

	IEnumerator Start()
	{
		yield return null;
		iPhoneUtils.PlayMovie("yourmovie.m4v", Color.white, iPhoneMovieControlMode.CancelOnTouch);
		Application.LoadLevel("theleveltoload");
	}

The magic trick seems to be using Start() as a coroutine instead of the default way we always do it.

I just wanted to add to this, that this didn’t work for me, but moving the “yield return null;” to just after the PlayMovie() did work. Not sure if its something that changed in Unity3 or iOS4 or both.

This method doesn’t work for me.

Yeah this is bugged for me as well. There is no way to get Unity to actually pause before the movie starts. There’s also no way to tell when a movie is done playing, so we’re plain screwed either way.

This still works for me in our game on the market currently, Mummy’s Treasure, playing the Chillingo animation, but curious if something changed in new Unity versions since then.

adding the yield after you call PlayMovie() solved it for us. It pauses the player, and picks up after the yield