Audio not working in html5

10,686

Solution 1

Firefox doesn't support MP3. It won't show the fallback message because it supports the audio tag. https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements#MPEG_H.264_(AAC_or_MP3)

Solution 2

You can't play MP3 files with such a code in Firefox.

See https://developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements

Share:
10,686
Admin
Author by

Admin

Updated on June 19, 2022

Comments

  • Admin
    Admin about 2 years

    I was adding audio to an HTML5 website. The audio works fine with FireFox and IE but does not show up and play in FireFox. Any ideas why and solution? Thanks in advance.

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    </head>
    
    <body>
    <audio controls="controls" autoplay="autoplay">
     <source src="cd.mp3" type="audio/mpeg" />
     Your browser does not support the audio element.
    </audio>
    </body>
    </html>
    
  • Admin
    Admin about 12 years
    Well, it should show it up on apptec.net/test3 as it has both mp3and ogg embedded in it.
  • Admin
    Admin about 12 years
    Well, it should show it up on apptec.net/test3 as it has both mp3 and ogg embedded in it.
  • lukad
    lukad about 12 years
    I can see the controls on your site (using Firefox 12) but I'm not sure how this is supposed to work: <source type="audio/ogg" src="mylife.mp3"></source>
  • Admin
    Admin about 12 years
    I think you mistyped the code. Its properly closed in the website.
  • lukad
    lukad about 12 years
    I meant the type being audio/ogg but the src still being mp3. If it was a real ogg file it would probably play in Firefox.
  • Admin
    Admin about 12 years
    Oh, my bad. There should have been .ogg there. Works now.