I'm trying to troubleshoot the scrubber for a custom video player and I'm coming across an issue with the scrubber being dragged past the progress bar fill if the flv hasn't fully loaded.
The player is here: http://mindfilemultimedia.com/stage/portfolio.html
If you play the video you will see that while the flv is still downloading, when you move the scrubber past the yellow progress bar into the white part of the line, the video player will freeze. It is doing that because the user is telling it to seek to a part of the video that has not been fully downloaded yet. What I want it to do is determine if the flv is still downloading and restrict the user to only be able to drag the scrubber up until the width of the yellow progress bar. Right now I have set the code to retrieve the bytesLoaded and bytesTotal and what I want to do is to say something like (in actionscript 3):
if (videoPlayer.bytesLoaded < videoPlayer.bytesTotal) {
var newBounds:Rectangle = new Rectangle(0, 0, (videoPlayer.bytesLoaded/videoPlayer.bytesTotal) * MovieClip(root).SeekBar.SeekProgressBar.width, 0);
MovieClip(root).SeekBar.SeekBarHandle.startDrag(false, newBounds);
}
I am by no means an actionscript person, so that was my attempt at doing what I needed. I have a feeling that it is not working because I'm accessing the classes incorrectly for the progress bar and the scrubber handle, but I am just taking the default classes as the seekbar was a flash components. Well, I can just be completely wrong. Any help here would be appreciated.