question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move preloading behavior to a plugin

See original GitHub issue

Following 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:closed
  • Created 3 years ago
  • Comments:26 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
becky-gilbertcommented, Jan 29, 2021

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.

1reaction
jodeleeuwcommented, Jan 18, 2021

I like the success variable in the data. Maybe also a list of failed_images, failed_audio, and failed_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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found