Jump to content
Search Community

Starting video in a Timeline

leonsky test
Moderator Tag

Recommended Posts

Hi there,

 

I think I just have a very simple question …

 

Is it possible (and how?) to play a video (already loaded) in a timeline as a part of the sequence? Without the addCallBack function? Like:

 

tl.append…

tl.append…

tl.playVideo() …and at the end of the video 

tl.append

 

Thanks in advance

Uli

 

 

P.S. I really appreciate you work!

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Sorry, there is no way to directly control a video from a timeline other than using a callback.

 

 

Also you may want to make sure you are using v12 of the GreenSock Animation Platform (GSAP) as it no longer makes you write super long code using append() and addCallback()

 

for instance this v11 code

var tl = new TimelineLite()
tl.append(TweenLite.to(mc, 1, {x:200, y:200}));
tl.append(TweenLite.to(mc, 1, {rotation:360}));

can be condesed to this in v12 using the TimelineLite's to() method

var tl = new TimelineLite()
tl.to(mc, 1, {x:200, y:200})
  .to(mc, 1, {rotation:360});

Its a much better way to go (less code, more flexible), and also the new call() method replaces addCallback(). Definitely check out the v12 docs for TimelineLite.

Link to comment
Share on other sites

Hi Carl,

 

thanks for the very quick response. Is there a best practice for embedding a video in the sequencing process?

Or, how to start a video at the end of a part in a timeline animation and after it reached its end continue with the rest of the timeline? Like inserting?

 

Thanks

 

 

P.S. I should check out V12 …

Link to comment
Share on other sites

You would add a callback in the timeline to start the video and pause the timeline (note in v12 there is an addPause() method for TimelineLite).

You would also have to configure an on complete listener that would fire when the video completes that would tell the timeline to play() again.

 

This post here: http://greensock.com/forums/topic/8043-video-in-timelinemax-using-addcallback/ illustrates how to communicate with a timeline when a video loaded with a VideoLoader is done playing.

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