Here is a page where we test various ways to embed .midi files into a web page. If you're interested in a different audio format, try one of the pages on the left.
First off, we can just put in a bare link. So here's the link to the famous Lord For Thy Tender Mercys Sake.
<object>
Tag Set
Then, we'll play Lord For Thy Tender Mercys Sake, but using an unadorned <object>
tag.
Add <param name="autoplay" value="false" />
to avoid autoplay.
Also, it seems, that the alignment is rather borked unless we put some height and width to the object.
But it doesn't work in IE6. Not even when one adds a "src" parameter.
<embed>
Tag Set
Ok, now we'll try the <embed>
element.
So, <embed>
, pretty much unadorned save for the autostart="false"
requirement works in IE6, whereas <object>
does not. Interestingly, I don't get a visible control in Opera or Chrome
New HTML5 <audio>
Tag Set
Ok, now we'll try the <audio>
element.
I had to add the attribute controls="controls"
to get it to show up in Opera. Despite the visible control, it does not play in Opera or Chrome.
Summary
Here's the dope:
- Opera
<object>
Works fine<embed>
Does not work--no visible control<audio>
Visible control, but doesn't work- IE6
<object>
Does not work<embed>
Does work<audio>
Does not work- IE8
<object>
Flakey<embed>
Does work<audio>
Does not work- Chrome
<object>
Works fine<embed>
Does not work--no visible control<audio>
Visible control, but doesn't work- FireFox
<object>
Works fine<embed>
Does not work--no visible control<audio>
Does not work- Safari
<object>
Works fine<embed>
Does not work--no visible control<audio>
Visible control, but does not work
So, it seems that <object>
but <embed>
does not. Then there's IE, where <embed>
is the only way to play .wav files. The new <audio>
tag doesn't play .midi files in any browser.
What's next?
Redo the exercise with some other formats, such as .wav and .ogg, whatever the hell that is. Do I want to hunt up some .aiff as well?