Video then load mainmenu scene help?

I am trying to load mainmenu after video with this code, but when I build it, the mainmenu doesnt load. I have all my scenes in my build settings.

function Start () {  
renderer.material.mainTexture.Play ();
while (renderer.material.mainTexture.isPlaying)
  yield WaitForSeconds(.1);

Application.LoadLevel("mainmenu");

}

Application.LoadLevel(6);