4 Replies Latest reply on Nov 23, 2009 12:06 PM by mdw1980

    How best to handle continuous scrubbing of an FLV

    mdw1980

      I'm a bit curious how to best handle the continuous scrubbing of an FLV, more specifically, a progressively downloaded FLV. What I mean by continuous scrubbing is the type of seeking you commonly see/get when continuously dragging a seek bar back and forth. I ask this because I can't seem to get my seek bar to provide consistent results.

       

      My intuition says to start by using a pause() action on the MediaPlayer upon the MOUSE_DOWN event of the seek bar thumb. Currently, my seek bar component uses a MOUSE_MOVE event listener to check for a change in the position of the thumb and dispatches an event. Thus, I am calling the seek() method of the MediaPlayer whenever my component dispatches it's change event. In my seek bar's change handler, I'm checking to make sure the MediaPlayer's seeking property is false and checking if the seek value is valid with the canSeekTo() method. Upon MOUSE_UP of the seek bar thumb, I'm using the play() method of the MediaPlayer to resume the playback of the video. Most of the time this seems to work ok and I get a nice continuous seeking of the FLV so long as it has a decent amount of key frames.

       

      It usually works ok but every so often two odd things happen as I'm scrubbing the video back and forth. The first thing is that sometimes the video just stops being able to seek and gets stuck on a random key frame. The other odd thing is that the video will resume play form the beginning for no apparent reason. Additionally, When I drag the seek bar to the far right and release it, I have a conditional that makes sure not to call the play() method otherwise the video begins playing from the beginning again. However, if I start dragging the seek bar around again, release it somewhere not at the end, and press my play button to resume, every once in a while the video starts from the beginning.

       

      What I'm most curious at this time is that if I'm just going about this wrong or if there's a slower rate at which I should be calling the seek() method. Any help would be appreciated. Cheers.