jPlayer is a jQuery plugin for playing back HTML5 audio, or using a Flash fallback. This is the audio player I have used on some eLearning courses in Minneapolis.
<li id="jp_cntl1">
<a href="javascript:void(0);" class="jp-play"></a>
<a href="javascript:void(0);" class="jp-pause"></a>
</li>
<div id="player1" class="jp-jplayer"></div> This will not show anywhere; it is simply needed when using jPlayer in this manner.$(document).ready(function() {
$("#player1").jPlayer( {
swfPath: "jQuery.jPlayer.2.1.0",
ready: function(event) {
$(this).jPlayer("setMedia", {
mp3: "../assets/audio/audio1.mp3",
oga: "../assets/audio/audio1.ogg"
});
},
play: function() { // To avoid both jPlayers playing together.
$(this).jPlayer("pauseOthers");
},
cssSelectorAncestor: "#jp_cntl1"
});
});