Joshua Stengel

Everything...Is going...
To be okay!

A Simple Way to Embed MP3s

Yahoo! has released an API that allow you to easily embed a media play that will automatically attach itself to MP3 links.  They had one that just linked to their own music library, but that's boring.

 

Here is a sample HTML page that has some MP3 links and an embedded audio player:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My MP3 Page</title> <script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script> </head> <body> <a href="http://podcastdownload.npr.org/anon.npr-podcasts/podcast/510008/17999726/npr_17999726.mp3?dl=1">NPR Podcast</a>
</body> </html>

 

Here's how it will render (Click the play icon):

NPR Podcast

When the play button is clicked, a media player will appear and the file will play in a pop-in media player.  It's nice because you have a good deal of control over the player just by changing the hyperlink.  It uses semantic HTML and an independent JavaScript file.

I wouldn't mind seeing more APIs that follow this type of implementation.  I know it puts a 3rd party in between you and the client, but so do things like PDFs and Flash.

Comments

mikedopp said:

This is awesome thanks for posting this.

Question is can we do video podcast with this technology?

mike dopp

# January 16, 2008 5:02 PM

jstengel said:

It was my original hope that that would be the function of the media player when I started looking into it.  In reading Yahoo!'s description of the project and the name "Yahoo! Media Player" I would like to think that turning it into some kind of universal media player is their ulimate goal.

I know I'll be keeping my eye on it...

# January 17, 2008 11:26 AM

Podcasting Directory said:

Excellent post. Could not have said it any better myself. Hat's off to a post well said.

# May 13, 2008 4:21 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)