Last active
June 2, 2020 08:27
-
-
Save cozzbie/448f9a427e52821ccf8c9853e403b329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const body = document.querySelector('body'); | |
const iframe = document.createElement('iframe'); | |
iframe.src = `<link to sound>`; | |
iframe.allow = 'autoplay'; | |
iframe.style.cssText = `display: none`; | |
body.appendChild(iframe); | |
// Definitly a better thing to do this is to have listeners | |
// on your sound instance. | |
setTimeout(() => { | |
this.body.removeChild(iframe); | |
}, 3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment