I am creating a page specifically for an ipad.
I have 12 audio players on a page. I need only one audio player to play at a time. The code below will work but only after you have started and stopped the players once. When you first play the songs it is possible for them all to play at the same time. Any ideas?
<script>
var currentPlayer;
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
if(currentPlayer && currentPlayer != thissound) {
currentPlayer.pause();
}
if (thissound.paused)
thissound.play();
else
thissound.pause();
thissound.currentTime = 0;
currentPlayer = thissound;
}
</script>
HTML
<a href="card3_ipad.php?card=country" onClick="EvalSound('song1'); return true;"
target="iframe"><img src="images/countrytab.gif" border=0 width=128 height=29>
</a>
<a href="card3_ipad.php?card=blues" onClick="EvalSound('song2'); return true;"
target="iframe"><img src="images/bluestab.gif" border=0 width=128 height=29>
</a>
Cheers
Tom