Skip to content
Discussion options

You must be logged in to vote

Hi @einGlasRotwein, thanks for reporting this and sharing your code - very helpful!

When I ran your experiment, I noticed that the image didn't load right away, which is because you're using timelineVariables for the image stimulus and the images aren't preloaded manually. I edited your code to manually preload the images, and now it works with render_on_canvas: true:

var picture_array = []; // for preloading

for (let i = 0; i < nTrials ; i ++) { // loop through picture numbers
    pictures.push({ image : `${imgPath}${i}.jpg` }); // push to timeline variable array
    picture_array.push(`${imgPath}${i}.jpg`);
}
// ...
jsPsych.init({
  timeline: timeline,
  preload_images: picture_array,
  

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@einGlasRotwein
Comment options

Answer selected by einGlasRotwein
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants