Skip to main content
Known Participant
June 1, 2023
Answered

Playback from CEP panel

  • June 1, 2023
  • 2 replies
  • 960 views

I've written a CEP panel that needs to retain focus.  I'd like a way to start/stop playback of the active sequence without having to select the timeline or program windows (causing the CEP panel to lose focus).

 

I thought I would be able to find a command in ExtendScript to start or stop playback, but I can't find anything.  Does such a command exist?

This topic has been closed for replies.
Correct answer Justin Taylor-Hyper Brew

Not in the offical API, but in the undocumented QE Dom you can.

app.enableQE();
qe.startPlayback();
qe.stopPlayback();

Some more info here: https://github.com/aenhancers/types-for-adobe-extras/blob/3bc960265b61830b07193b27d4e48304e9352542/Premiere/12.0/qeDom.d.ts#L43

2 replies

Justin Taylor-Hyper Brew
Brainiac
June 12, 2023

Not in the offical API, but in the undocumented QE Dom you can.

app.enableQE();
qe.startPlayback();
qe.stopPlayback();

Some more info here: https://github.com/aenhancers/types-for-adobe-extras/blob/3bc960265b61830b07193b27d4e48304e9352542/Premiere/12.0/qeDom.d.ts#L43

Known Participant
June 13, 2023

Thanks, Justin.  I assumed it was in QE somewhere.

 

startPlayback and stopPlayback currently do the same thing - toggle playback.  Basically, it's like pressing the spacebar.

 

I found something that works a bit better, at least for my purposes:

 

qe.project.getActiveSequence.player.play(1)

 

This is exactly what I was looking for.  You can set the playback speed using the single parameter:

1 = normal speed

0.5 = half speed

-1 = reverse

0 = stop

 

There's also a stop() method that does the same thing as play(0).

 

Posting all this for any future visitors.

Justin Taylor-Hyper Brew
Brainiac
June 13, 2023

Great find!

Bruce Bullis
Community Manager
Community Manager
June 8, 2023

There is nothing in PPro's ExtendScript API to control Program monitor playback; just Source monitor.

 

Please explain more about "needs to retain focus"; from a user's perspective, what's the workflow you're trying to support?

 

 

Known Participant
June 13, 2023

Sorry, Bruce.  Just noticed your question.  The reason the panel needs to retain focus is that it utilizes key bindings to perform some actions (so if I press "a", my script does something; if I press "b", it does something else, etc.).  Those key bindings only work if the panel has focus.  If I can't control playback from my panel, I have to switch back and forth between the timeline and my panel - which is annoying.  The spacebar key to start/stop play works from within the panel, but I normally want the sequence to play at double speed so I can quickly work through the entire sequence.  To do that, I have to click on timeline, start it at doublespeed, then quickly switch back to my panel before any keys need to be pressed.  Make sense?

 

The solution I found below works great.  I just added some additional key binds to emulate the J, K, and L key actions (backward, stop, forward, etc.).  Now I never have to leave my panel and my custom key binds always work.

Bruce Bullis
Community Manager
Community Manager
June 14, 2023

Yes, makes sense; glad you found a solution that works for you.