0

I'm working on a webgame site, and part of that includes playing audio. I want to host my own server for this site at least to start because I've never done it before and it sounds like a good learning experience for me. I got the site and the game working and I can play the game. Others have also been able to play it without issue using my router's external IP after I set up forwarding etc.

The game includes a soundcloud audio player widget that I made invisible so that I can use my own graphics for buttons. I ran into the problem of not being able to autoplay audio, but fixed it with allow="autoplay" in the iframe containing the widget.

All seemed good until today, when I bought a cheap domain name and set a domain pointer to my IP address. This is through domain.com and the pointer is of type URL Stealth. It sounds like that's the best way to go so that I don't expose my router's external IP address.

Now, however, my site will pull up, but on hitting the play button the console spits out the error saying

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

I am of course confused because I can still play the game correctly if I type my IP address and port into the search bar as I have been doing. The only difference that I can see is the domain name. So what is it about this domain pointer that causes my play button to stop working?

I can also confirm that if I do as it asks and make a gesture on the page I can then play the game as normal.

For reference, I'm using chrome and haven't tested on any other browsers.

As usual, I never know what information I've left out of the explanation, so feel free to ask and I'm happy to provide.

Elkelthen
  • 17
  • 8
  • Does this answer your question? [Google Chrome Javascript issue in getting user audio - The AudioContext was not allowed to start](https://stackoverflow.com/questions/55026293/google-chrome-javascript-issue-in-getting-user-audio-the-audiocontext-was-not) – Suman Majhi Mar 23 '22 at 18:43
  • It looks like a great start, but now I'm getting told that getAudioContext() is not defined. It appears to be a function associated with P5.js, which I downloaded and tried to import, and was told that I can't use an import statement outside of a module. This seems like I'm doing something wrong. Any pointers? – Elkelthen Mar 23 '22 at 19:14
  • Please put some code in this qus, or in a new qus. – Suman Majhi Mar 23 '22 at 19:19

0 Answers0