summaryrefslogtreecommitdiff
path: root/platform/javascript/audio_driver_javascript.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-01-21 10:57:49 +0100
committerGitHub <noreply@github.com>2019-01-21 10:57:49 +0100
commitbef383985e7be5c8253e32758d96fa7a6e3fd257 (patch)
tree6a5f72f59d602959d0ecaf8aad3e1cee94bd7204 /platform/javascript/audio_driver_javascript.cpp
parent38a5a23a12ceaccd09b22a009dc680ec5037e367 (diff)
parent8f1669e77182af21a0c46e5314f61cc9a83beb27 (diff)
Merge pull request #25168 from eska014/html5-autoplay
Deal with Google's HTML5 autoplay policy
Diffstat (limited to 'platform/javascript/audio_driver_javascript.cpp')
-rw-r--r--platform/javascript/audio_driver_javascript.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp
index fcfc75280d..16fdc267f3 100644
--- a/platform/javascript/audio_driver_javascript.cpp
+++ b/platform/javascript/audio_driver_javascript.cpp
@@ -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 */