Attempt system for sounds tab previews
This commit is contained in:
parent
ea7dc7a732
commit
8144ec46bd
2 changed files with 28 additions and 13 deletions
|
|
@ -263,8 +263,8 @@ let audioReady;
|
|||
export async function initAudioOnFirstClick(options) {
|
||||
if (!audioReady) {
|
||||
audioReady = new Promise((resolve) => {
|
||||
document.addEventListener('click', async function listener() {
|
||||
document.removeEventListener('click', listener);
|
||||
document.addEventListener('mousedown', async function listener() {
|
||||
document.removeEventListener('mousedown', listener);
|
||||
await initAudio(options);
|
||||
resolve();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue