Originally Posted by thbz
in firefox i'm getting the player for half second and them nothing.
chrome does something similar.
i don't really know why is that. help..
Make sure you supply a
attribute with the relevant audio codec specified in the
parameter. For Ogg Vorbis, you would use
Make sure your server is also configured to send a
content-type: audio/ogg; codecs=vorbis
header (with the relevant codec substituted) for the Ogg file as well. If you're using Apache .htaccess files, this is easiest done, by using *.oga file extensions and then specifying the following in your .htaccess file (again, with the relevant codec substituted):
AddType "audio/ogg; codecs=vorbis" .oga
audio/ogg; codecs=vorbis should have been quoted. Not quoting it causes Apache to send out a malformed header (
Live Example: https://patrick.dark.name/web.dev/de...io.playback.1/
Live Example Code:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="application/xml" href="../style.sheets/boilerplate.xslt"?>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:p="https://patrick.dark.name/">
<title>Demo for CodingForums.com Thread 305367: <![CDATA[<audio>]]> element is not working</title>
<p:title>Demo for CodingForums.com Thread 305367: <cite><code><![CDATA[<audio>]]></code> element is not working</cite></p:title>
<p>This demo demonstrates how to play Ogg Vorbis audio with MP3 audio fallback using an <code>audio</code> element.</p>
<p class="note">Note: In Windows Internet Explorer 11, the player won’t materialize due to a bug apparently caused by the <abbr title="Extensible Stylesheet Language Transformations">XSLT</abbr> transformation. The audio can be played in that browser by right‐clicking the player area in that browser and selecting <q class="menu.command">Play</q> from the shortcut menu that appears.</p>
<source type="audio/ogg; codecs=vorbis" src="audio/air.on.the.g.string.oga"/>
<source type="audio/mpeg" src="audio/air.on.the.g.string.mp3"/>
<figcaption><cite>Air on the G String</cite> by August Wilhelmj</figcaption>
<p>The audio was obtained from <a href="https://archive.org/details/Bach-airOnTheGString">https://archive.org/details/Bach-airOnTheGString</a></p>
Also worth noting that there's a bug in Firefox 25 Beta 10 where the audio doesn't play correctly when
is enabled. Pressing pause doesn't pause the audio and pressing play again causes the audio to play again over the audio that didn't get paused. Closing the tab doesn't stop the audio. Closing the browser to force the audio off causes the browser to hang in the background. That's why I didn't put the song on autoplay in the demo. I'm not sure if this bug is in the release version (24) or not.