views:

259

answers:

1

I'm creating a flex-based video player, using the FLVPlayback component (imported from Flash Pro CS3). I've reskinned all of the player controls and linked them in, and it's all working really well...

However, if you try to seek beyond the point where the video has loaded (it's using progressive download), the video completely freezes. You can no longer pause, play, seek to somewhere else, or anything. I understand it can't actually play a point in the video that hasn't been downloaded, but the whole thing seems to just become unresponsive. The interface and other elements are still working so it hasn't crashed the whole flash player, just the FLVPlayback component.

Any ideas?

A: 

So I gave up trying to get the seek handling built into the seekbar skin to work, and wrote my own custom click handler which checks how much has loaded and if you try to click past the loaded point, it just jumps as far as the loaded point:

private function seekHandler(e:MouseEvent):void{
    if(video.source){
        var seekto:Number = (e.stageX-seekBar.x)/seekBar.width *100;
        var loaded:Number = (video.bytesLoaded/video.bytesTotal)*100;
        if(seekto > loaded){
            seekto = loaded-0.5;
        }
        video.seekPercent(seekto);
    }
}

Would be good if this was fixed in future versions of the FLVPlayback component though.

Tom