naivesound/glitch

Does Not Play in Chrome

carlsmith opened this issue · 1 comments

I just tried the online demo using Chrome on OS X, and the Play Button does not do anything (beyond changing the icon to Pause). There's no error message or anything.

I tried refreshing the page, pasting an official example (Kraftwerk - Das Model) into the editor and hitting play. Nothing happened.

The only thing in the console (beyond a few messages from Glitch about Binaryen) is an error message that says The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page, which includes a link to Chrome's policy on autoplaying stuff (in short, you can't).

Note: The error message appears as soon as the page loads (before the Binaryen messages, and not in response to me pressing Play).

I'd assume (without looking at the code) that you're starting Web Audio when the page loads. If so, you instead need to wait and start it from within a callback that's bound to a UI event. In Glitch, that'd obviously be the Play Button.

Restart your device.