How to find end of a video clip ?

I want to navigate to a URL after video clip ends. And i searched and got something to start with, but its not working fine for me and am getting errors.

Can anyone help…

Am getting the following error,
Unexpected yield,
Unexpected token Ienumerator… :frowning:

function Update () {

if (Input.GetButtonDown ("Jump")) {

if (MyVideoTexture.isPlaying) {
	MyVideoTexture.Pause();
	audio.Pause();
	}
else 
	{
		MyVideoTexture.Play();
		audio.Play();			
       // Wait for the clip to finish

	    StartCoroutine(Wait(MyVideoTexture.duration));
          	Application.OpenURL ("http://unity3d.com/");
	}
}

}

private IEnumerator Wait(float duration)
{
yield return new WaitForSeconds(duration);}

Because the on the beginning of the code you use javascript and on the end you use C#.

function Update () {

if (Input.GetButtonDown ("Jump")) {

if (MyVideoTexture.isPlaying) {
    MyVideoTexture.Pause();
    audio.Pause();
    }
else 
    {
       MyVideoTexture.Play();
       audio.Play();        
       // Wait for the clip to finish

        WaitAndURL(MyVideoTexture.duration);
            
    }
}

}

function WaitAndURL (duration : float) { 

    yield WaitForSeconds(duration);
   Application.OpenURL ("http://unity3d.com/");
}