Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2011
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts

    HTML5 audio and IOS headache.

    Hi,

    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>
    Last edited by huskie; 11-30-2012 at 03:23 PM.

  • #2
    Regular Coder
    Join Date
    Jun 2011
    Location
    CA
    Posts
    105
    Thanks
    0
    Thanked 10 Times in 10 Posts
    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:
    http://www.w3schools.com/tags/tag_audio.asp

  • #3
    New Coder
    Join Date
    Apr 2011
    Posts
    33
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •