Why does the video autoplay when I programatically add a clip to the timeline?

For context, this is part of my custom workflow, and I’m adding this into an action in src/docks/timelinedock.cpp.

I’m opening an image like this (not sure if there is a better way):

QString path = "/tmp/test.ping"
QList<QUrl> urls{path};
MainWindow *mainWin = qobject_cast<MainWindow *>(window());
mainWin->openMultiple(urls);

Then I add it to the timeline like this:

this->overwrite(currentTrack(), -1, QString(), false);

This works, and it gets added to the timeline like I expect, but the clip starts playing automatically. Am I supposed to be calling the pause function right after adding the clip? If not, what am I doing wrong that is causing it to play? Is it because of the empty string instead of XML?

The auto play is being caused by the openMultiple call. You could try the open() function instead and set “play = false”.

1 Like

This worked. Thank you!