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
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 19, 2022Comments
-
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 about 12 years
-
Admin about 12 years
-
lukad about 12 yearsI 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 about 12 yearsI think you mistyped the code. Its properly closed in the website.
-
lukad about 12 yearsI 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 about 12 yearsOh, my bad. There should have been
.ogg
there. Works now.