Skip to content

Instantly share code, notes, and snippets.

@coneybeare
Created June 5, 2010 17:16
Show Gist options
  • Save coneybeare/426791 to your computer and use it in GitHub Desktop.
Save coneybeare/426791 to your computer and use it in GitHub Desktop.
<audio id="audioplayer" preload controls loop style="width:424px;">
<source src="audio.mp3">
<source src="audio.caf">
</audio>
<script type="text/javascript">
var audioTag = document.createElement('audio');
if (!(!!(audioTag.canPlayType) && ("no" != audioTag.canPlayType("audio/mpeg")) && ("" != audioTag.canPlayType("audio/mpeg")))) {
AudioPlayer.embed("audioplayer", {soundFile: "audio.mp3"});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment