Move preloading behavior to a plugin
See original GitHub issueFollowing ideas from #1234:
I’m also wondering if part of the solution here is to convert the preloading features into a plugin and move them out of
jspsych.js
. This might make it easier to parameterize, and also allows for easier customization by researchers. It would also provide a built-in solution to perform partial caching of materials throughout the experiment. We’ve seen that feature needed in many cases, e.g. #724.
The downside is that automatic preloading wouldn’t be as easy to support. But we could still populate a list of media to preload at the start of the experiment and allow the plugin to access that list. So the experience might be:
var preload = {
type: 'preload',
auto_preload: true,
images: [...],
audio: [...],
video: [...],
show_progress_bar: true,
loading_message: '<div>whatever html here.</div>',
show_detailed_errors: true,
max_load_time: 60000
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:26 (10 by maintainers)
Top Results From Across the Web
Preload cache - WP Rocket Knowledge Base
The Preload Cache feature emulates a visit to your site's pages to generate cache files. Since the feature is enabled by default on...
Read more >Post layout distorted due to “resource was preloaded…”
Hello everyone,. My WordPress layout is disorganised or distorted. Can you help? Not sure why, initially we had a plugins or wordpress update...
Read more >Prevent layout shifting and flashes of invisible text (FOIT) by ...
Preloading optional fonts in Chrome removes the possibility of layout jank and flash of unstyled text. This matches the required behavior as ...
Read more >Preload, Prefetch And Priorities in Chrome | by Addy Osmani
What is the caching behavior for <link rel=”preload”> and <link ... Use preload to move the start download time of an asset closer...
Read more >Preloading images with jQuery - javascript - Stack Overflow
A quick, plugin-free way to preload images in jQuery and get a callback function is to create multiple ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep the code above is from my test. The tests for timelines in objects with conditional and loop functions are working. I can push my changes to the branch tomorrow if that helps.
I like the
success
variable in the data. Maybe also a list offailed_images
,failed_audio
, andfailed_video
that gives the path to each failed load resource?Good catch on the
preloadAudio
! I think this is a good moment to make things consistent.