Interviewer icon indicating copy to clipboard operation
Interviewer copied to clipboard

Load dependencies before displaying protocol

Open bryfox opened this issue 7 years ago • 4 comments

There are some cases where we may want to ensure that dependencies (other than protocol.json) are loaded before a protocol is considered "loaded" and ready for display.

  • Custom worker scripts
    • e.g., the nodeLabelWorker, which may otherwise cause a delay in label rendering (see #613 discussion)
  • large data sets (also from #613, and related to #413)

bryfox avatar Aug 01 '18 14:08 bryfox

This may also impact large image/video assets. For example, the looped video with sound in the development protocol takes several seconds to load, even on fast devices.

jthrilly avatar Sep 14 '18 09:09 jthrilly

Does anybody have any thoughts on a technical implementation for this?

jthrilly avatar Sep 14 '18 09:09 jthrilly

We won't want to load large assets into memory; we should let the browser handle natively (e.g., streaming video from disk).

Workers should be small, and are potentially required on every interface, so preloading makes sense. I've been assuming external data will be small enough to fit in memory, but if that's not necessarily the case, then we wouldn't include that here (and we may need to reconsider how we cache in #413).

Implementation: we can make this part of the protocol loading epic; once all dependencies are met, then PROTOCOL_LOADED is dispatched.

bryfox avatar Sep 14 '18 15:09 bryfox

Would the streaming method resolve the issues we currently see with a delay when initially showing a large asset, do you think?

jthrilly avatar Sep 17 '18 09:09 jthrilly