Interviewer
Interviewer copied to clipboard
Load dependencies before displaying protocol
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)
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.
Does anybody have any thoughts on a technical implementation for this?
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.
Would the streaming method resolve the issues we currently see with a delay when initially showing a large asset, do you think?