mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
emscripten: Automatically resume audio contexts
This uses the mechanism added in emscripten-core/emscripten#10843 which was applied to SDL1 and OpenAL. This adds the same for SDL2. This also reverts commit 865eaddffed50dbd13e6564c3f73902472cf74e8 which did something similar, but the new mechanism is more effective.
This commit is contained in:
parent
edaf3f9c9c
commit
20be1d634b
@ -215,6 +215,9 @@ EMSCRIPTENAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscaptu
|
|||||||
} else if (typeof(webkitAudioContext) !== 'undefined') {
|
} else if (typeof(webkitAudioContext) !== 'undefined') {
|
||||||
SDL2.audioContext = new webkitAudioContext();
|
SDL2.audioContext = new webkitAudioContext();
|
||||||
}
|
}
|
||||||
|
if (SDL2.audioContext) {
|
||||||
|
autoResumeAudioContext(SDL2.audioContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return SDL2.audioContext === undefined ? -1 : 0;
|
return SDL2.audioContext === undefined ? -1 : 0;
|
||||||
}, iscapture);
|
}, iscapture);
|
||||||
|
Loading…
Reference in New Issue
Block a user