Recommendations for HTML 5 Audio tag not working in Firefox
Hi,
I've searched all throughout the web for a fix to this bug and have not had much luck. The HTML 5 audio tag does not work in Firefox. I was wondering if you have any suggestions/work around for this bug?
Thanks!
Discussions are closed to public comments.
If you need help with Cascade CMS please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ryan Griffith on 05 Dec, 2012 01:10 PM
Hi,
Just a few questions to see if we can narrow things down a bit:
Each browser supports different file formats, please see the *Formats and Audio Support * table on this W3Schools page to see if your format is supported by Firefox. If not, you would want to supply an additional audio source for Firefox to fallback on.
Please let me know if you have any questions.
Thanks
2 Posted by Ryan Griffith on 13 Dec, 2012 08:09 PM
Hi,
Just wanted to follow up to see if you had a chance to view my recent comment.
Please let us know if you have any questions.
Thanks.
Ryan Griffith closed this discussion on 26 Dec, 2012 07:16 PM.
sjenoch re-opened this discussion on 17 Jan, 2013 02:20 PM
3 Posted by sjenoch on 17 Jan, 2013 02:32 PM
Hi,
I've looked into the w3schools page and have included both mp3 files and ogg files for cross browser compatibility, and updated my xslt code to adjust to both mp3 and ogg files. But, it is still not working correctly in firefox.
Here is the page XML data (I apologize for the format):
and here is the XSLT:
Thanks!
4 Posted by sjenoch on 17 Jan, 2013 02:35 PM
And here is the URL to the page:
http://webdev.smcm.edu/_slackwater-new/journals/vol6instantcity/kni...
5 Posted by Ryan Griffith on 17 Jan, 2013 02:44 PM
Hi,
It looks like you need to adjust your
<xsl:if>
statement used to output the OGG file to use the correct XPath that matches your XML structure.Try the following:
Please let me know if you have any questions.
Thanks
6 Posted by sjenoch on 17 Jan, 2013 03:24 PM
Sorry I think my poorly provided formatted XML tree structure caused an issue. Take a look at the first screenshot. The OGG node is not nested within the audio node, so your provided path did not work. So I changed it back to
I took a screenshot of source code in firefox, and it is reading the .ogg file, but the audio player appears and then disappears...and im still confused as to why.
7 Posted by Ryan Griffith on 17 Jan, 2013 03:51 PM
Thank you for supplying the additional screenshots.
I found the following Mozilla Support Forum post that may explain what is occurring. I confirmed that the src attributes within your
<source>
element do not resolve to an audio file, but a 404 page. Can you confirm the path is correct and/or the file has been published to the web server?Also, it looks like that portion of the Format is still a bit off. Notice that you are not checking the OGG element's path in your
<xsl:if>
statement. Let's try the following:Please let me know if you have any questions.
Thanks
8 Posted by sjenoch on 17 Jan, 2013 04:18 PM
Ahhhhh! That was the issue. The file was not published to the server. Thank you so much for your help!! I really appreciate it.
sjenoch closed this discussion on 17 Jan, 2013 04:18 PM.
sjenoch re-opened this discussion on 01 Feb, 2013 09:30 PM
9 Posted by sjenoch on 01 Feb, 2013 09:30 PM
Hi again,
I've run into yet another issue with this audio player. The audio tag is only picking up the .ogg file in all browsers even though the xml is reading both the .mp3 and the .ogg. (see screenshot of xml tree)
Here is the test page link :
http://www.smcm.edu/_slackwater-new/journals/vol6instantcity/knight...
It is reading the .ogg file in:
- Firefox (which is what it is supposed to do) -Chrome (supports both .ogg and .mp3 so I am not too worried there) -IE9 (this is an issue, .ogg files are not supported, .mp3's are ok) -Safari (this is an issue, .ogg files are not supported, .mp3's are ok)
maybe I have my xslt wrong?
Or is there another browser detection method that will chose the correct file? I've tried looking for some javascript browser detection for html 5 but I could only find stuff for detecting mobile devices.
Thanks so much for your help!
10 Posted by Ryan Griffith on 04 Feb, 2013 02:04 PM
Hi,
I suspect the issue here is that your Format is only generating one
<source>
element, which is causing the OGG file type to override the MP3 file type (if one exists).What you'll want to do is tweak your Format that to create a new
<source>
element for each file type so your browsers have different sources to fall back on. For additional information, see http://www.w3schools.com/html/html5_audio.asp.Let me know if you have any questions.
Thanks
11 Posted by sjenoch on 04 Feb, 2013 03:10 PM
Thank you! This worked! I had to change audio/path to mp3/path in order for it to catch the mp3 file according to the xml tree. But it now works in all browsers. Thanks so much again for all of your help!
sjenoch closed this discussion on 04 Feb, 2013 03:10 PM.
Ryan Griffith re-opened this discussion on 04 Feb, 2013 04:24 PM
12 Posted by Ryan Griffith on 04 Feb, 2013 04:24 PM
Glad to hear that did the trick. Something else you could do to reduce the redundant
<source>
tags is to use a<xsl:for-each>
loop to generate the elements. Something like the following:Note: this assumes the group identifier corresponds to a valid source type attribute value. For example, the mp3 group identifier generates a
type="audio/mp3"
attribute.Ryan Griffith closed this discussion on 04 Feb, 2013 04:24 PM.