How to get movie duration

I am using following code to play a movie file in unity.
the problem i am having is I can’t find out the duration of the movie. I want to load next scene after the end of the movie.

	void Start () {
		wwwData 				= new WWW(url);
        guiTexture.texture 		=;
		movieTexture			= guiTexture.texture as MovieTexture;
	void Update () 
        if (!movieTexture.isPlaying && movieTexture.isReadyToPlay)
			audio.clip = movieTexture.audioClip;
	IEnumerator WaitTillMovieIsOver() 
		Debug.Log("started movie");
			yield return null;
		Debug.Log("movie over");
	} always return -1

for some reason WaitTillMovieIsOver is also not getting called …

can anyone provide some help on this?

You need a “StartCoroutine” on the line where you call the Ienumerator function. You always need to use that with Yield code.
line 19:


As for the movie length, you can use MovieTexture.isPlaying

movieisplaying = true;