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

Add event timestamps with recording stream time #111

Open
2 tasks
becky-gilbert opened this issue Nov 6, 2024 · 0 comments
Open
2 tasks

Add event timestamps with recording stream time #111

becky-gilbert opened this issue Nov 6, 2024 · 0 comments

Comments

@becky-gilbert
Copy link
Contributor

Summary

Our plugins/extensions that include webcam recording should save event timestamps to the data, so that video recordings can be linked to the stimulus/response events logged in the data. These should contain the video stream time, i.e. time since the start of recording.

To do:

  • Log the current video stream time when each trial starts/loads for trial and session recording.
  • Try adding timestamps for other events if possible, like (1) stimulus onset/offset, (2) responses, (3) trial finish, (4) others?

Implementation notes

The trial recording extension will need to hook into events that occur during the trial that's being recorded, since we don't have control over that plugin code. The only trial events that we have access to are start, load, and finish.

For session recording, we could add some custom code into the jsPsych event hooks that logs timestamps to the window CHS object. This is because our session recording system isn't an extension (it's just start/stop plugins), so we don't have a way of generating/storing data in between those trials. jsPsych has event-related callbacks at the data- and experiment-levels (not just for trials), so we could set up logging at the experiment level and just add a conditional that checks for ongoing session recording. Another option is to turn our session recording system into an extension (but still require the start/stop plugins) to gain more control over logging.

We might be able to add some custom public methods for getting the recorder's current timestamp, which the user could put into their trial code to get the video timestamp that corresponds with the desired event. The user would have to put this in one of the trial's event-related callbacks and set up the trigger for the timestamp logging method, e.g. in response to key presses or button clicks during their trial.

It might be worth looking at how the other jsPsych extensions log event data. Though I suspect they don't have this same problem with syncing extension timing and jsPsych experiment timing because they don't operate on separate "clocks".

@becky-gilbert becky-gilbert mentioned this issue Nov 6, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant