Video wont pause?

OS: Mac
PsychoPy Version: 2021.1.4

I have a routine that I want to last for 20 seconds. During that time I want to play a 12 second movie. I want the movie to pause on the last frame and for that image to stay up until the routine is over (at 20 seconds).

I’ve tried multiple different suggestions from this forum but seem to be missing something because nothing has worked. The most intuitive suggestions i’ve seen is this (i’ve inserted a code component and entered these lines for each frame:

if (((myMovie.status === PLAYING) && (myMovie.getCurrentFrameTime() >= (myMovie.duration - 0.05)))) {
    myMovie.pause();
}

But the routine just advances when the video has ended. I don’t get any errors. Any suggestions?

我不太明白你的意思,


你或许应该选中这个
image

Does the routine end immediately or does it continue to show the rest of your test_text component (which tells us if unticking the ForceEndRoutine is working)?
What happens if you tell the Movie to last forever and then end the trial by your own means?

Hi jon – thanks for responding! When I leave the routine as is (with the empty text block) it does continue to show the rest of the test_text component after the video has ended which suggests that yes, unticking the ForceEndRoutine is Working. The video just ends and the screen goes black (instead of the video pausing on the last frame). When I make the movie last forever and add a button response with a forced end routine (removing the test_text component) the same thing happens. It did look like maybe the video paused for a second on the last frame which makes me think that maybe the pause just doesn’t have the correct duration?

When you’ve got your movie set to 1.0 seconds I’m sure the issue is just that, although you may successfully pause the movie, the time check then decides that it is finished and stops it.

Why pausing would fail with the time set to infinite I don’t know. Could you share the study with us to investigate?