View Full Version : HTML5 audio and IOS headache.

11-30-2012, 03:40 PM

Is there anyone that can help resolve the issue of using the HTML5 audio tag when pressing an image. I am designing an app to use on Apple IOS for my young child to learn images and sounds together. I am using the HTML5 tag with some inline js but when I add this it throws my images about. I am guessing that there is some kind of hidden control to the side of the image that is shifting them around the screen?

<a class="pig" href="javascript:;" onclick="document.getElementById('pig').play();"><audio id="pig" src="audio/pig.mp3"></audio><img src="images/pig.png" height="230" width="230" alt="Pig"/></a>

11-30-2012, 06:49 PM
I'm not sure you should wrap an audio tag inside an <a href>, only the img tag.

Look at this page and see if it helps:

12-04-2012, 11:46 AM
I have looked at loads of information on audio tags but I haven't managed to get the audio working on mobile safari without them. Any other suggestion would be great.