Jump to content
Search Community

gotoVideoTime(0) on video that has already played once

halhead test
Moderator Tag

Recommended Posts

Hi

 

Apologies if this question has already been asked, I have had a look but could not see anything.

 

My issue is that I am loading two videos which give the illusion of a single video forwards and backwards - video 2 is the reverse of video 1. On the inital playback everything is fine, however once each video has played once there are then problems. On using gotoVideoTime(0) on either video after they have initally played there is a short instance where the last frame of the video displays before the video plays.

 

This URL - http://www.kplcconnections.com/system/a ... oLoader.as - cliams that If for example, after an FLV has finished playing, we gotoVideoTime(0) the FLV and immediately check the playProgress, it returns 1 instead of 0 because it takes a short time to render the first frame

 

My question is whether anybody has come up with a workaround for this issue or whether there is a known method for detecting when the video is at the first frame so it can only be made visible at this point?

 

Many thanks

Link to comment
Share on other sites

Hi,

 

I had the same kind of issue. When my flv got to the end of playback I couldn't get it to loop. I have it working now. I have embedded cue points in the flv and when it detects the final one it runs this code:

videoLdr.gotoVideoTime(0);

 

It might not work with your code but declared videoLdr at the beginning of the class rather then in the function so it could be accessed in other functions. I also changed the code:

 

videoLdr.videoPaused != videoLdr.videoPaused;

to

videoLdr.videoPaused = false;

or

videoLdr.videoPaused = true;

where relevant.

 

hope that helps. Shout if you need any more help.

 

James

Link to comment
Share on other sites

This URL - http://www.kplcconnections.com/system/a ... oLoader.as - cliams that If for example, after an FLV has finished playing, we gotoVideoTime(0) the FLV and immediately check the playProgress, it returns 1 instead of 0 because it takes a short time to render the first frame

 

My question is whether anybody has come up with a workaround for this issue or whether there is a known method for detecting when the video is at the first frame so it can only be made visible at this point?

That quote from the class file was rather out of context - it was a comment in the code that was explaining what VideoLoader does to FIX that problem that is in Adobe's NetStream class. So if you gotoVideoTime(0) and then check playProgress, you will indeed see 0, not 1. However, your question is more about when you can sense that the new frame has rendered and that is indeed a tricky issue. I did a lot of experimenting with that and here's what I found...

 

If you're publishing to FP10 or later, NetStream appears to dispatch an Event.RENDER Event when the NetStream renders a new frame. But that won't work if you're publishing to FP9, and it's also undocumented. In most cases, you could just wait for one ENTER_FRAME event to elapse and then the NetStream will have rendered the new frame (that's not ALWAYS the case though which is maddening). If you're skipping to a new part of the video, you could also listen for the VIDEO_BUFFER_FULL event to get dispatched which is generally a good way of knowing that the frame has rendered. If anyone else knows how to sense the render of a NetStream frame with 100% accuracy (including in FP9), I'd love to hear it.

Link to comment
Share on other sites

Cheers guys, thanks very much for the quick responses.

 

I have fixed the issue by declaring _prevVideo.gotoVideoTime(0) as soon as a new video plays - where _prevVideo is a reference to the last video played. I already had this solution in mind however I just wanted to check I wasn't missing any simple method that existed for eradicating the problem first. This was the simplest and quickest solution to my own issue and I hope if anyone else has the same problem then this post will help them.

 

As this is my first post let me say how appreciative I am of the work done by Greensock and once this particular project is finished - an interactive training video for a major corporate client - I will have no trouble convincing my superiors to obtain a shockingly green membership as not only has the development time been halved but the final product is already shaping up to be faster, smoother and more visually engaging based purely on the use of TweenMax and LoaderMax. Fantastic work!

Link to comment
Share on other sites

As this is my first post let me say how appreciative I am of the work done by Greensock and once this particular project is finished - an interactive training video for a major corporate client - I will have no trouble convincing my superiors to obtain a shockingly green membership as not only has the development time been halved but the final product is already shaping up to be faster, smoother and more visually engaging based purely on the use of TweenMax and LoaderMax. Fantastic work!

That's great to hear. Glad the tools have sped up production and made your end product perform better. I really appreciate the fact that you want to help support ongoing development and assistance by being an advocate for your company joining Club GreenSock. Developers like you make all this possible.

 

Good luck with your project.

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...