Jump to content


videoLoader gotoVideoTime update on scrub

Moderator Tag

Recommended Posts



I have a loadermax videoLoader loading an flv.

I then have a 'scrubber' to scrub through the video by calling :




When I play the swf in the flash IDE or in the standalone player (mac) the video scrubs as expected, you see the video frame corresponding to the scrubbers location.


The problem is when I play the swf in a browser (embedded in a html or opened directly) the video display does not show the scrubbed-to frame until the scrubber is released.

i.e. its possible to scrub indefinately and see no change till mouse_up.


is there a way to make the video scrub in a browser the way it does in the IDE?


i've attached test ('sample.flv' not included to save on filesize).



Link to comment
Share on other sites

It seems your files aren't attached.


Its been my experience that flv's rarely scrub well if at all. I've hear some rumblings about this getting better in more recent versions of the Flash Player or AIR (perhaps in conjunction with a rtmp server), but haven't witnessed it for myself.


It was my understanding that due to the way video is buffered and decoded that live scrubbing isn't really worth pursuing.


The 1 thing I've heard repeatedly though is that to achieve smooth scrubbing your flv needs to be encoded with lots of keyframes. Take a look here:




here is an interesting note about keyframes


About Keyframes: Because video compression only stores incremental changes between frames (except for key frames), it is not possible to fast forward or rewind to any arbitrary spot in the video stream. That is because the data for a given frame only represents how that frame was different from the preceding frame. For that reason it is beneficial to include key frames at arbitrary intervals while encoding video. For example, a key frame may be output once for each 10 seconds of video, even though the video image does not change enough visually to warrant the automatic creation of the key frame. That would allow seeking within the video stream at a minimum of 10 second intervals. The down side is that the resulting video stream will be larger in size because many key frames were added when they were not necessary for the visual representation of the frame.




I don't think there is anything VideoLoader can do to enhance the scrubability of your flv :(

Link to comment
Share on other sites

Carl is right about the keyframes, but it sounds like you were able to scrub fine in the IDE and local Flash Player, so maybe something else is at play. Can you scrub BACKWARDS online? If the only problem is scrubbing forward, I suspect that it's just that the video hasn't loaded that part adequately yet. Just a guess, but it's tough to know without seeing your files and being able to publish for ourselves.

Link to comment
Share on other sites


thanks for your detailed response, I understand that a flash video seek can only lock to a keyframe.

Unfortunatly though I almost entirely certain its not a keyframe issue as it seeks fine in the flash IDE, and not in a browser.

I have double checked with a few flv including one I specially encoded with keyframes set every 5 frames to confirm this.


please note its not that it doesn't seek at all in a browser only that the video display does not update until you let go of the scrubber. I.e. start scrub at 1 second move to 10 seconds and hold it there for ages, the display does not show a frame near 10 seconds, then let go of scrubber and it displays!

my video control also incudes a clock that shows the video currenttime is correctly being moved during the scrub.




i've been running this with ALL files local so there should be no issue with buffering or not being fully loaded. my scrubber also includes a preload graphic to show that the file has indeed fully loaded.

I have of course uploaded and checked running from a server too in case the browser was doing something weird, but that made no difference.

(BTW checked in up-to-date firefox, chrome and safari on mac, flash debug player



hopefully i've correctly attached test files this time!




just to say again, all scrubs fine with a test publish in the flash IDE, and also fine if I double click on the swf file and it opens directly in the flash standalone player.

problem is when the swf is opened in a browser, either by drag n' drop swf into a browser window or more conventially by html embed via swfobject.



Link to comment
Share on other sites

forgot to say, I included greensock.swc so you know the exact verison I'm using (should be latest) but in the test.fla you will need to link it in settings > library path and 'merge with code'.

(sorry if preaching to the choir!)

Link to comment
Share on other sites



I just compiled your files using my own sample.flv.

I could not do any "live" scrubbing. The display would only update when I released the progress bar. The video would not seek to a new position while scrubbing back and forth.


Tested in Flash CS6 IDE preview and Stand Alone Player 11.2


I'm thinking there is something special about you flv, perhaps it has a ton of keyframes.

Link to comment
Share on other sites



strange that you get no 'live' scrubbing at all in the out of browser players!

(just in case it matters i'm on osx10.6.8, cs5.5, debug player11.2)


anyway, I now have a solution... the issue seemed to be something with me using an enterframe listener to manage the update of the display. I have changed this to a Timer and it now works fine, even in browser.


Not sure is this is VideoLoader or flash but good to know if you need to patch.


here's the updated scrubber AS:



would be great if you could give it a quick test on your setup to confirm.



Link to comment
Share on other sites

Yes, the new class allows me to scrub with a live screen update in the flash ide and in google chrome.


My system is very similar to yours: Osx 10.6.8 flash player 11.2

Link to comment
Share on other sites

great, thanks so much for your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.