I recently read a book about html 5 and promptly started using some of the 
features described in my project.

I experienced a problem with the audio tag and Firefox which I reduced to a 
minimalistic example illustrating the problem.

*The experiment:*

*1) Control Situation*

I put "Main_theme.webm" and "Main_theme.mp3" in a folder along with 
test.html which is written as follow:

<!DOCTYPE html>
<html>
    <title>HTML5 Audio</title>
    <audio autoplay>
        <source src="Main_theme.webm">
        <source src="Main_theme.mp3">
        Just because you are getting older doesn't mean your browser has 
to. Go get a recent browser and get a youthful feeling!
    </audio>
</html>

The soundtrack plays for Opera, Chrome, IE and Firefox (in Safari, the 
soundtrack doesn't play and the message appears instead which is weird as 
www.caniuse.com lists audio tags as supported in recent versions of safari, 
but anyways, this is a side detail).

*2) Deployment Situation*

I put the "Main_theme.webm" and "Main_theme.mp3" audio files in the 
<app>/static/audio directory.

I use the default Tornado server that comes with the Framework.

I edit the index.html page of the default controller to be:

{{extend 'layout.html'}}
    <audio autoplay>
        <source src="{{=URL('static','audio/Main_theme.webm')}}">
        <source src="{{=URL('static',''audio/Main_theme.mp3')}}">
        Just because you are getting older doesn't mean your browser has 
to. Go get a recent browser and get a youthful feeling!
    </audio>

Here, the result is the same as the control situation, expect for the fact 
that the soundtrack doesn't play in Firefox.

When I look at the http requests/responses in Firebug, I see a 206 code for 
the audio file request (which is the same as in Chrome, expect that Chrome 
plays it).

So, what is faulty? Me? Firefox? Web2py? The Tornado server? A combination 
of the previous?

Any insights would be welcome.

I won't die if the audio for my app doesn't play with Firefox, but it would 
be nice.

Reply via email to