Replies: 2 comments
-
How many images are you preloading? If your experimental design permits it, I would try to have a trial where I set the image in the trial on_start function, something like (just the general gist, I did not test this code): on_start : function() {
img.onload = () => {
img.style.visibility = '';
setTimeout( () => { img.style.visibility = 'hidden'; }, 0.1);
}
}
img.src = src With this approach the visibility of your trial image would be set only after the confirmation that it has been loaded. Wondering if this would still lead to some images not showing. |
Beta Was this translation helpful? Give feedback.
-
I am the developer of the Psychophysics plugin. I am somewhat skeptical about whether it is possible to present stimuli for short durations like 100 ms using jsPsychHtmlKeyboardResponse. It probably depends on the accuracy you are looking for. The results of my previous investigation might be helpful although I didn't directly check the accuracy of jsPsychHtmlKeyboardResponse. Best regards, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm running a jsPsych experiment where I present images very briefly (100 ms) using jsPsychHtmlKeyboardResponse. Occasionally, the stimuli fail to render visually, although JavaScript logs indicate successful loading and rendering timestamps.
Solutions I've tried:
Preloading and explicit decoding:
I used jsPsych preload and explicitly decoded images with img.decode().
Some images threw EncodingError, but successfully decoded images occasionally failed to render visually. Additionally, the erroneous images sometimes did show.
Hidden DOM pre-rendering:
I pre-rendered all images invisibly in the DOM before the experiment, but this also did not resolve the issue:
Has anyone faced a similar issue with intermittent image rendering failures at very short durations? How can I reliably render brief-duration image stimuli?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions