Onset/offset times of the video stimuli are not saving

Hi,

Unfortunately, coding and translating code from PsychoPy (python) to PsychoJS (Java Script) is not straight forward. Code used in one may not work in the other one, or you may need to make some adjustments. Most translations and limitations have been compiled in a document by @wakecarter in this post: PsychoPy Python to Javascript crib sheet

STARTED and FINISHED are the attributes you would use for PsychoJS to check every frame whether a video is playing or the component is no longer in use (the attribute STOPPED takes place when people paused the video but the component is still active), for PsychoPy you need to use PLAYING and STOPPED (in here the component has a special attribute called PAUSE, ).

You can either get the time stamp of the experiment when something in particular occurs by using globalClock.getTime() available both in PsychoJS and PsychoPy, or get the time stamps of the millisecond in the video at which people stopped playing it.

To get the time stamps of the video you need to use myVideo._movie.currentTime in PsychoJS or use myVideo.getCurrentFrameTime() in PsychoPy

For further details please read the documentation and the source code of the component you are interested in.

For PsychoPY you can check the source code here: psychopy.visual.movie — PsychoPy v2021.3

For SPychoJS you cna check the source code here: psychojs/visual_MovieStim.js.html at main · psychopy/psychojs · GitHub

Best,
Miguel