Saturday, December 16, 2006

Questions on embedding MP3's in a web page

March 12, 2008 UPDATE:

I'm not sure if this option was available when I wrote the original post (see below), but now Blogger makes it extremely easy to embed RSS and iTunes friendly references to media files in posts.
  1. Go to Blogger's Dashboard.
  2. Click the Settings link for the blog you want to change.
  3. Click the Formatting tab.
  4. Scroll down to Show Link Fields and select Yes from the dropdown.
  5. Create a new post (or edit an old one). You should now see a Link field and Add enclosure link.
  6. Click Add enclosure link. An Enclosures section should appear.
  7. Under the Enclosures section, enter the URL to your MP3 or other media file. Blogger should automatically populate the value for the MIME Type field when you tab to (or click on) the next field.


I'm playing around with podcasting (not really in the true iTunes sense yet, just embedding the file a blog entry) and am looking for information on how to prevent <embed> tag from automatically downloading the file. The idea is that I don't want my blog home page or archive pages that have multiple audio posts on them to take forever to load because they're downloading 4 or 5 MP3's. I know you can prevent the file from playing automatically, but I also don't want it to start downloading the file until the play button is pressed.

For that matter, perhaps <embed> is not the right solution. Is there a decent free flash player that anyone has experience with? I tried a few that I found via google, and wasn't too happy with them. Free is key. I'm hosting my MP3 files at OurMedia. Ideally the flash file itself would be a hosted situation, but I suppose I could find a free web host if it was something I had to download and host myself.

Another solution I'm considering is kind of workaround. Blogspot doesn't let you include javascript in your post html, but you can include it in your layout template. So I thought about assigning a specific id or class to the direct link I include in each audio post. e.g. <a href="" class="blogcast" >. The javascript would search each page for all links of class "blogcast" and prepend that section with a play button that when pressed would call a javascript function that would replace the button with the embed tag set to automatically play the file. Whew! Seems convoluted, but my attraction to that option is that it keeps things free. I'm cheap like that.

No comments: