Deal with Google's HTML5 autoplay policy

Resume audio context after mouse, touch or key input.
This commit is contained in:
Leon Krause 2019-01-20 14:25:15 +01:00
parent 09e4d7e9eb
commit 8f1669e771
3 changed files with 16 additions and 0 deletions

View file

@ -146,6 +146,15 @@ void AudioDriverJavaScript::start() {
/* clang-format on */
}
void AudioDriverJavaScript::resume() {
/* clang-format off */
EM_ASM({
if (_audioDriver_audioContext.resume)
_audioDriver_audioContext.resume();
});
/* clang-format on */
}
int AudioDriverJavaScript::get_mix_rate() const {
/* clang-format off */