mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
Deal with Google's HTML5 autoplay policy
Resume audio context after mouse, touch or key input.
This commit is contained in:
parent
09e4d7e9eb
commit
8f1669e771
3 changed files with 16 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue