Jump to content
Search Community

VideoLoader fastforward

rhinolu test
Moderator Tag

Recommended Posts

Hi

 

I want to make a simple video player with VideoLoader. But when I try to "fast forward" my video,

 

addEventListener(Event.ENTER_FRAME, onFrame);
private function onFrame(e:Event):void
{
 if (videoLoader.duration - videoLoader.videoTime < 1) {
removeEventListener(Event.ENTER_FRAME, onFrame);
 }else {
videoLoader.videoTime += someSpeed;
 }
}

 

I found "videoTime" it never change, then

 

in http://www.greensock...loadermax/#bugs

  • If you seek() to a certain time in a NetStream and then immediately check its “time” property, it is often incorrect (reflects the previous time, not the new one)

so, I change my code, just skip some frames do videoLoader.videoTime += someSpeed; not every frame.

 

it works! But not smooth enough.

 

If there has a better solution? Thanks.

Link to comment
Share on other sites

Flash only allows you to skip to keyframes in a video, so if you need the ability to smoothly jump to any frame, you'd need to literally encode your video with ALL frames as keyframes which would significantly bloat the file size. That's just the nature of compressed videos. So, for example, if you have keyframes every 30 frames and you try to jump to frame 14, it would actually land on frame 1 (the closest keyframe). That might make it seem jerky or like VideoLoader is buggy, but it's just a limitation of compressed videos and NetStreams. Make sense?

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.
×
×
  • Create New...