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

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu #3

Open
swethamanur opened this issue Mar 22, 2019 · 5 comments

Comments

@swethamanur
Copy link

Hello,
Thanks for the code!
I am getting the following issue:
The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

Could you please help me resolve?
Thanks

@DavidLazic
Copy link
Owner

@swethamanur

If you have set the autoplay option, it would fail these days on both desktop / mobile because of new web security rules. If I remember correctly, autoplaying video / audio content was allowed only in muted state.

@maxi032
Copy link

maxi032 commented Jun 9, 2019

Hi. Can you please give more details into how to solve this?

@LazicDavid
Copy link
Contributor

@maxi032

I'm guessing you're having the same problem on Chrome.
As the browser warning links to Google WebAudio, it's explained there that the Chrome WebAudio API doesn't support autoplay anymore.

You need to change the source code:

  • Try creating the Visualiser instance on a user trigger event (e.g. click)
  • Create custom volume control and set the decoded audio to a muted state initially (not sure if this will work).

So, yeah, I don't see a simple workaround.

@xewl
Copy link

xewl commented Jul 26, 2019

To elaborate on this, @LazicDavid is correct and gives 2 valid options (well, at least 1, haven't tested the muted state).
Another option I've had success with is to check for an ?autoplay GET-parameter (decodeURIComponent), and to only set the audio stream when all scripts are loaded, based on that parameters' existence, only then starting the playback. [Use case was an online radio station]
(thought I'd share)

@ghost
Copy link

ghost commented Jun 12, 2022

oh
firefox is working

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

5 participants