Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Control Play, Pause, Resume a footage based on a slider using time remap (or else?)

  • Control Play, Pause, Resume a footage based on a slider using time remap (or else?)

    Posted by Eric Benacek on November 24, 2016 at 3:47 pm

    Hello,

    is there a way to control a video playback/resume thru an expression?

    here’s the context :

    I have a comp playing a video,
    a slider to control it’s Y position,
    at 50 it’s in the center, at 0 and 100 it’s out of view.

    What I would like to do is to pause/freeze the video,
    when it’s between 0 and 20, and 80,100.
    and plays/resume when it’s between 20 and 80.

    Thank you for your time!

    Matt Callac replied 6 years, 5 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    November 25, 2016 at 7:38 pm

    Something like this maybe:


    s = effect("Slider Control")("Slider");
    f = timeToFrames(time);
    n = 0;
    for (i = 0 ; i < f; i++){
    v = s.valueAtTime(framesToTime(i));
    if (v > 20 && v < 80) n++;
    }
    framesToTime(n)

    Dan

  • Eric Benacek

    December 5, 2016 at 2:22 pm

    Thank you so much!!!!
    I’m still trying to understand the voodoo behind it but it works!

  • Matt Callac

    February 11, 2020 at 3:42 pm

    Just wanted to say thanks to Dan. Was trying to figure out how to use time remap values to control another layer’s property. couldn’t figure it out and then found this thread and saw the expression you wrote above. I had tried the math.round function, but didn’t think to try timetoframes. Thanks a bunch.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy