Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Standardize checking status of movie stimulus playback in PsychoPy and PsychoJS #6055

Open
jfkominsky opened this issue Nov 29, 2023 · 1 comment
Labels
🌟 enhancement Proposed improvement or feature request.

Comments

@jfkominsky
Copy link
Contributor

Description

The most recent versions of PsychoPy use the MovieStim.isFinished property to report whether a movie has finished playback. PsychoJS uses PsychoJS.Status.FINISHED. The FINISHED status was removed from Python in favor of the isFinished property, but no corresponding property was added to PsychoJS.

You can work around it with a bit of effort, but even in a code component you can't use auto->js because you have to use the isFinished property in Python and the FINISHED status in PsychoJS.

Purpose

Prior to the MoveStim rewrite and use of ffpyplayer library, both PsychoJS and PsychoPy used a "FINISHED" status, so it was possible to use auto->js code translation or a condition to start a component (e.g., show a response only after a movie finishes playing within a single trial) that would work both locally and online.

Is your feature request related to a problem?

Just that you end up creating experiments that work either locally or online but not both without a very careful workaround, and it's unintuitive and bad for standardization. It's also not well-documented, since the MovieStim API page just references isFinished.

Describe the solution you would like

I can think of three fixes, not sure what would be easiest:

  1. Add an isFinished property to MovieStim in PsychoJS
  2. Add a redundant "FINISHED" status back in to PsychoPy's MovieStim
  3. Change auto->js to interpret ".isFinished" as "=== PsychoJS.Status.FINISHED" (not ideal because it doesn't necessarily work as a condition for a component)

Describe alternatives that you have considered

N/A

Additional context

No response

@jfkominsky jfkominsky added the 🌟 enhancement Proposed improvement or feature request. label Nov 29, 2023
@peircej
Copy link
Member

peircej commented Nov 29, 2023

We added .isFinished to the Python class so that we could distinguish between a movie that had reached its end versus one that had been told by Builder to finish. Basically the class needs to have a record of how the file-reading is going that's independent of how the experiment is running. BUT the aim was for the movie.status also to be updated on every frame so that checks on movie.status==FINISHED would still work

@TEParsons implemented that for SoundComponent in lines 165-171 but it looks like the same wasn't done for Movie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement Proposed improvement or feature request.
Projects
None yet
Development

No branches or pull requests

2 participants