Skip to main content
Participant
November 1, 2023
Question

Pausing a video comp with slider control

  • November 1, 2023
  • 1 reply
  • 358 views

Hi,

 

I am working on a MOGRT template where i am displaying two videos alongside each other, like a split screen.
The first window starts playing the video right away, as the other window stays paused. Then after a few seconds, the first window pauses the video and the second video starts playing. 

 

I have made the second video keep paused until the first one is playing, but i am unable to figure out a way to pause the first comp video when the second video starts playing. 

I am attaching a screenshot of my project. 

I would be very thankful if someone could help me with any technique/expression.

Thanks

This topic has been closed for replies.

1 reply

Mylenium
Legend
November 1, 2023

You are overcomplicating this unnecessarily. Just edit the video natively and use the MOGRT only to add your text or whatever.

 

Mylenium

O HaroonAuthor
Participant
November 1, 2023

I am creating this for a team of editors who will be using these in their adobe premiere projects. So any help is appreciated please.

Dan Ebberts
Community Expert
Community Expert
November 1, 2023

If you added a checkbox to your Controls layer, you could use an expression like this for the time remapping of your first video layer:

p = thisComp.layer("Controls").effect("Checkbox Control")("Checkbox");
t = p.value ? time : 0;
if (p.numKeys > 0){
  n = p.nearestKey(time).index;
  if (p.key(n).time > time) n--;
  if (n > 0){
    t = p.key(1).value ? p.key(1).time : 0;
    t += p.value ? time - p.key(n).time : 0;
    for (i = 2; i <= n; i++){
      t += p.key(i-1).value ? p.key(i).time - p.key(i-1).time : 0;
    }
  }
}
t

The first video layer will run while the checkbox is on. Then you could add an expression like this to the time remapping of your second video layer:

time - thisComp.layer("Screen switch 1").timeRemap;

which will cause the second video layer to run whenever the first video layer is paused. Or, you could control the second video layer with its own checkbox so that you could control the two layers independently.