Created
December 13, 2011 20:34
-
-
Save jwoschitz/1473762 to your computer and use it in GitHub Desktop.
Safari & JavaScript Audio
This file contains hidden or 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
<html> | |
<body> | |
html5 audio test | |
</body> | |
<script> | |
/* | |
tried to use the HTML5 audio without <audio /> tags, just JavaScript | |
works in Chrome, also in FF if you replace .mp3 with .ogg - does not work in Safari | |
*/ | |
window.onload = function(){ | |
var audioElem=new Audio(); | |
audioElem.src="mysound.mp3"; | |
audioElem.play(); | |
} | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment