Created
November 13, 2019 13:43
-
-
Save subzey/a34f9bf92420e51e324cde4b59683a80 to your computer and use it in GitHub Desktop.
iframe autoplay
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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<script> | |
function playSound() { | |
var ifr = document.createElement('iframe'); | |
ifr.allow = 'autoplay'; | |
ifr.srcdoc = '<!doctype html><audio controls autoplay><source src="https://www.tradingview.com/static/sounds/alert/alarm_clock.mp3" type="audio/mp3"></audio>'; | |
document.body.appendChild(ifr); | |
} | |
setTimeout(playSound, 1000); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment