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

Sound loop breaks without user input #5

Closed
dmrib opened this issue Oct 18, 2019 · 2 comments
Closed

Sound loop breaks without user input #5

dmrib opened this issue Oct 18, 2019 · 2 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@dmrib
Copy link
Member

dmrib commented Oct 18, 2019

During development I realized that sometimes Chrome would not play the audio correctly, giving the following error on console:

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

This happens because we are currently playing the audio without a effective way of giving the option to our users of knowing that a track will be played on that website.

https://github.com/processing/p5.js-website/issues/396
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio

We must change the behavior of the sketch to only play audio after some kind of user input.

@dmrib dmrib added bug Something isn't working good first issue Good for newcomers labels Oct 18, 2019
@dmrib
Copy link
Member Author

dmrib commented Oct 18, 2019

I just had a good idea to solve this:

What if instead of starting the terrain scene at the sketch execution, we create a Start button on a kind of welcome screen that would handle this event?

This will also be probably useful to make us able to collect the webcam stream from the user.

dmrib added a commit to dmrib/spacecadet that referenced this issue Oct 19, 2019
@anothergoldenmonkey
Copy link
Member

Seems like a valid solution. 👍

anothergoldenmonkey added a commit that referenced this issue Oct 19, 2019
Make soundtrack state configurable, closes #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants