tags:

views:

97

answers:

2

Hello all,

I have a small WordPress site. I do a lot of audio work and I'm trying to post HTML5 audio clips in blog entries on WordPress. For some reason it isn't working. It might have something to do with the style I'm using on my WordPress site but I haven't been able to nail it down. I know my audio tags are valid, as they work elsewhere.

Here's an example audio tag:

<audio src="http://files.dannystewart.com/dom2008.mp3"&gt;&lt;/audio&gt;

And here's a page demonstrating it not working:

http://www.dannystewart.com/html5-audio-test/

I'm quite sure this is something very simple that I've just missed, but any pointers would be appreciated.

Thanks!

+1  A: 

You seem to be missing the controls attribute. This made it all work in Chrome for me:

<audio src="http://files.dannystewart.com/dom2008.mp3" controls></audio>

Note it won't work in Firefox - it doesn't support MP3 files. See http://adactio.com/journal/1669/ for a possible solution.

Olly Hodgson
I knew it had to be something simple. Thanks so much for your help, that got it resolved.
Danny Stewart
A: 

Cool sound!

The problem is your doctype: html5 allows <!DOCTYPE html> only. Which is not to say that browsers won't support html5 elements with other doctypes...but YMMV.

sje397
Incorrect - The browsers will allow you to use new HTML5 features with an old doctype. Also, you can put HTML into your posts using the backtick character: `
Olly Hodgson
Well I downloaded the page, opened it locally - no sound...then removed the extraneous text, and it works. From the HTML5 spec, I gather the browser is under no obligation to interpret any other doctype as HTML5. (Chrome dev version, Kubuntu Lucid)
sje397