Closed crcdng closed 5 years ago
thanks for the issue, this is probably related to the Autoplay policy on Safari. planning on updating soon as more browsers adopt a similarly strict Autoplay policy.
Since the same Autoplay Policy is now also affective for Chrome, all the same examples are broken for Chrome as well. Please ask authors to fix them, they are awesome!
Firefox Nightly breaks them too as of today. The autoplay policy also broke my app that I'm developing using Tone.js. Is there a way to fix this in the code, please?
@eltomito the solution is to invoke Tone.context.resume()
from an explicit user action. There is little that a library can do to get around the Autoplay policy, it is something that each developer must do for their own application. i will add a note to the top of the README
fixed with the latest release!
@tambien Yes, this solves it! But there's a catch: Tone.context.resume() has to be the first thing you do with the suspended context. Otherwise, audio is irreversibly disabled for the page. Even just creating a Tone.Synth() when the context is suspended breaks it beyond repair. At least that's how it works in Firefox Nightly.
🙄 oh man, why would they do that?!
The following examples played from the website (tone.js r12) do not work, i.e. they fail silently without error message in Safari 12.0.1 on Mac 10.14.1. The examples not listed work.