Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

How to play Audio on iOS device (iPhone/iPad) using HTML5

$
0
0

I am using Adobe Edge Animate to create an HTML5 site that plays audio using JavaScript on an onclick() event.

 

In my html I have the following between my <SCRIPT> tags:

function aud_play_pause(filename) {

  var myAudio = document.getElementById(filename);

  if (myAudio.paused) {

    myAudio.play();

  } else {

    myAudio.pause();

  }

}

 

 

In my <BODY> I have:

<audio id="sound">

          <source src="media/sound.mp3" type="audio/mpeg" />

          <source src="media/sound.ogg" type="audio/ogg" />

</audio>

 

In Adobe Edge Animate, I have an onclick event:

aud_play_pause("sound");

 

This works on IE, Chrome, and Safari. It also works on Safari when accessed by an iPhone.

 

When I attempt to package the application with PhoneGap and deploy on a device, no sound is played. My application works perfectly with the exception of sound.

 

Can someone guide me to a link that has instructions on how to play sound in HTML5 so that it works when deployed on an iPhone or iPad?

 

Thank you,


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>