Determining if a movie is downloaded

Hi, guys,

I have a web application with a WebMoviePlayer.

I want the application to close the web page with the movie when movie reaches its end and transition to the next web page.

To achieve this I created a timer with the following code

if MoviePlayer1.Position >= MoviePlayer1.Duration then
  self.Close
  WebPage3.show
end

The problem with the code is that if the movie is too long, the code executes before the movie has a chance to completely download.

To give time for the movie to download, I adjusted the above code to the following one


Dim t1 as Integer

t1= t1 + 1 

if t1>= 15 then

if MoviePlayer1.Position >= MoviePlayer1.Duration then
  self.Close
  WebPage3.show

end

end

Is there a better way to determine if the movie has been downloaded rather than arbitrarily set a 15 seconds delay?

Thank you in advance,

Val