Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joshuapowell/917841 to your computer and use it in GitHub Desktop.
Save joshuapowell/917841 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="description" content="" />
<title></title>
<!-- Flash player dependant upon WP Audio Player by Martin Laine -->
<!-- Download Javascript & Flash player here http://wpaudioplayer.com/ -->
<script src="js/audio-player.js"></script>
<script type="text/javascript">
AudioPlayer.setup("js/player.swf", {
width: 290
});
</script>
</head>
<body style="background-color: #F9F9F9;">
<h1 style="font-family:Helvetica,Arial,sans-serif;">HTML5 Audio Test</h1>
<audio id="audioplayer" src="test.mp3" controls="controls">Your browser does not support the audio element.</audio>
<!-- Fallback for browsers that don't support playing MP3 files via <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: "test.mp3"});
}
</script>
<footer><small>Originally based on the Gist by <a href="https://gist.github.com/coneybeare">coneybeare</a></small></footer>
</body>
</html>
<audio id="audioplayer" src="test.mp3" controls="controls">
Your browser does not support the audio element.
</audio>
<!-- Fallback for browsers that don't support playing MP3 files via <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: "test.mp3"});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment