You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The record-video extension saves the data as a base64 string in the jsPsych, and there doesn't seem to be a way to intercept the video blob data before that point. Base64 strings are a useful way of storing non-text data as strings so that it is available to researchers via the jsPsych data, but it's also non-ideal in many cases (for instance because video recordings can quickly generate a huge amount of data).
It would be really useful if the record-video extension provided some optional function callback parameters that would get called during specific extension events (initialization, on_start, on_finish, etc.) and, when video data is available, receive it as an argument. This would allow researchers to send the video .webm files directly to a server.
If these parameters made available at the extension initialization, then it could look something like this:
conststart_custom_upload=()=>{// set up upload};constfinish_custom_upload=(videoBlob)=>{// handle data};letjsPsych=initJsPsych({extensions: [{type: jsPsychExtensionRecordVideo,params: {on_start: start_custom_upload,on_finish: finish_custom_upload}}]});
The
record-video
extension saves the data as a base64 string in the jsPsych, and there doesn't seem to be a way to intercept the video blob data before that point. Base64 strings are a useful way of storing non-text data as strings so that it is available to researchers via the jsPsych data, but it's also non-ideal in many cases (for instance because video recordings can quickly generate a huge amount of data).It would be really useful if the
record-video
extension provided some optional function callback parameters that would get called during specific extension events (initialization, on_start, on_finish, etc.) and, when video data is available, receive it as an argument. This would allow researchers to send the video .webm files directly to a server.If these parameters made available at the extension initialization, then it could look something like this:
For naming these extension parameters, it might make sense to use the extension event names (
on_start
etc.) and/or the media recorder API event names (ondataavailable
, etc.).Remember to add the following in the PR:
cc @okaycj
The text was updated successfully, but these errors were encountered: