0
votes

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

1

1 Answers

0
votes

Read apple guideline

it is not possible for ios (iphone, ipad), you can check above link

Multiple Simultaneous Audio or Video Streams

Currently, all devices running iOS are limited to playback of a single audio or video stream at any time. Playing more than one video—side by side, partly overlapping, or completely overlaid—is not currently supported on iOS devices. Playing multiple simultaneous audio streams is also not supported. You can change the audio or video source dynamically, however. See “Replacing a Media Source Sequentially” for details.