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 audio-context bug, enable keyboard if sound|midi is on, and update the config panel UI #4

Merged
merged 2 commits into from
Oct 8, 2023

Conversation

davidhaley
Copy link
Contributor

@davidhaley davidhaley commented Oct 8, 2023

  • Add a global disabled state to the keyboard. The keyboard is enabled if the user enables sound or midi.
  • Update the configuration panel UI
  • Fix bug: "An AudioContext was prevented from starting automatically. It must be created or resumed after a user gesture on the page"

…st be created or resumed after a user gesture on the page"

Background: For security reasons, the browser a user-gesture to before creating the audio-context.

Fixed by updating keyboard.js with a new `start()` function that calls `callMain()` and `postRun()`. `start()` is called in response to the user turning sound on.
- Update UI for config panel. Add a few CSS color vars.
- Add a 'placeholder' select option inside midi options (update logic to account for it)
- Display warning and disable keyboard if neither sound or midi is enabled (ignore midi if user doesn't have it)
@davidhaley davidhaley changed the title Fix audio-context bug, add a global disabled state if sound|midi isn't enabled, and update the config panel UI Fix audio-context bug, enable keyboard if sound|midi is on, and update the config panel UI Oct 8, 2023
@davidhaley davidhaley mentioned this pull request Oct 8, 2023
@ad8e ad8e merged commit ff436fb into ad8e:main Oct 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants