Online experiment MovieStim frameIndex not working?

URL of experiment: Yue Li / video_test_button · GitLab

Description of the problem:

I want to present a video to participant and let them play and pause the video, and record the frame index of the video when participant paused the video. I used MovieStim.frameIndex to get the current frame number of the paused video. The data were then saved in the “videoFrameLastPaused” and “videoFrameAllPaused” columns in the .csv file. Everything worked perfectly when I ran it offline. All data were saved correctly.

However, when I pilot it on Pavlovia, although the program was able to run without error, it was unable to record the frame index. In the data file, the videoFrameLastPaused and videoFrameAllPaused were null, instead of numbers. I also tried to use MovieStim.pts to get the present timestamp of the video, getting null again. I then tried getCurrentFrameNumber(), and it gave me an error TypeError: video_pt_react.getCurrentFrameNumber is not a function.

Can anyone help with this? Is there way to get the current frame index of a video for online experiments? Thanks!!!

Just update this in case anyone has a similar issue.
I’ve figured this out. MovieStim.frameIndex or getCurrentFrameNumber() won’t work for PsychoJS. The solution is to use “._movie.currentTime”, which gives you the present timestamp of the video. I used videoCurrentFrame = Math.round(video_pt_react._movie.currentTime * 10); to get the current frame index. “videoCurrentFrame” is the variable I created to store the current frame index. “video_pt_react” is my MovieStim; and 10 is the frame rate of the video (mine is 10 fps).