greggman / html5bytebeat

Bytebeats in HTML5
http://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html
MIT License
426 stars 37 forks source link

Chrome autoplay policy change has broken audio playback #5

Closed petercowal closed 6 years ago

petercowal commented 6 years ago

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio

It looks like the changes described here require the audio context to be created or resumed after the user interacts with the page; otherwise, playback won't occur.

greggman commented 6 years ago

does this fix it?

https://github.com/greggman/html5bytebeat/commit/39ceeb248abdfc714b85d072c5df1d5eed1d6063

note: you might have to clear your cache. If you're running with the patch you'll see a "play" message you have to click before it starts

petercowal commented 6 years ago

Yup, works great! That was super quick, I am seriously impressed.