Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mic check file import #44

Open
becky-gilbert opened this issue Sep 3, 2024 · 0 comments
Open

Fix mic check file import #44

becky-gilbert opened this issue Sep 3, 2024 · 0 comments

Comments

@becky-gilbert
Copy link
Contributor

TL;DR

We have a separate mic check file that should be part of the lookit-jspsych repo, in the record package, but has been copied into the lookit-api files because of problems accessing this file from the built record package.

Summary

The microphone check requires the use of addModule, which must load a separate JS file that creates/registers the Audio Worklet Processor for the mic check. I haven't been able to figure out how to access this JS file in the built version of the record package, and have resorted to loading it from the lookit-api static directory. This solution is not ideal because it belongs with the record package, and we're copying it into the lookit-api repo.

Options:

  1. Because the mic check code has to be separate file, the code can't be added into the record package's main output file in dist (index.browser.js). But we could copy the file as-is into dist and try to load from there (so far I haven't been able to get this to work).
  2. Keep the mic check file in the lookit-api static directory, and add a build process that updates the lookit-api version whenever changes are made to the lookit-jspsych file (e.g. hook for commits on main).
  3. Publish/host the mic check file separately (via NPM/unpkg?) and load it as a URL. This way, in the record package code, instead of doing this: .addModule("/static/js/mic_check.js")
    we could do this:
    .addModule("https://unpkg.com/lookit-jspsych/record/mic_check.js").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant