how to go to next video playing in movie texture when the playing video ends

i want to play the video automatically when the scene starts and when the video is over the next video should appear …
i used the yield WaitForSecons(movieDuration); but when the user pauses the video …it goes to next video evenif the video is not over and not finished watching…

where and how should i use the yield or other unit functions

below is the code i used…
function OnGUI(){

GUI.BeginGroup (Rect (0, 0, 1200, 675));

			GUI.DrawTexture (Rect (290,50,200,150),part1Video);
				//part1Video.Play();
				MyWaitFunc1();
				
				if (part1Video.isPlaying == true){
						playButtonString="pause"; //it's playing so the button should pause.
						MyWaitFunc1();
						
				}	
				else{
						playButtonString="play"; //it's not playing and the button should play the movie.
						
				}
				
				
				if (GUI.Button (Rect (290,200,30,30),playButtonString) == true)
				{
						print("u pressed play button of 1");
						if (part1Video.isPlaying == true){
								part1Video.Pause();
								
								}
						else{
							part1Video.Play();
							 
							}
				}
				
				if (GUI.Button (Rect(320,200,30,30),"Stop")==true)
					part1Video.Stop();

if(dispVieo2==true)
	{
	GUI.BeginGroup (Rect (0, 0, 1200, 675));
			
			if(firstWatched==true)
			{
			GUI.DrawTexture (Rect (290,50,200,150),part2Video);
				
				if (part2Video.isPlaying == true){
						playButtonString="pause"; //it's playing so the button should pause.
				}	
				else{
						playButtonString="play"; //it's not playing and the button should play the movie.
				}
				
				if (GUI.Button (Rect (290,200,30,30),playButtonString) == true)
				{
						print("u pressed play button of 2");
						if (part2Video.isPlaying == true)
								part2Video.Pause();	
						else{
							part2Video.Play();
							 
							}
				}
				
				if (GUI.Button (Rect(320,200,30,30),"Stop")==true)
					part2Video.Stop();
			}
}
function MyWaitFunc1()
	{
		yield  WaitForSeconds(3.37);
						print("next");
						part1Video.Stop ();
						dispVieo1 = false;
						dispVieo2 = true;
						firstWatched=true;
	}

Basicly you would need a pausable timer. This could look something like this (C#, not testet). When the user pauses the movie you would set playing to false:

private float timer = 0;
private float movielenth;
private bool playing = false;

IEnumerator StartTimer()
{
    while (playing)
    {
        timer += Time.deltaTime;
        if(timer >= movielenth)
        {
            timer = 0;
            playnext();
            yield break;
        }

        yield return null;
    }
    yield break;
}

Here …