Saturday, November 29, 2008

Stream music from any website using Yahoo Media Player

>

Earlier this year, Yahoo released a clever service – the Yahoo Media Player that allowed any site owner to embed an MP3 media player into their site by adding just a small line of code. With a little hack, this media player can be embedded into any site that links to MP3 files allowing you to enjoy streaming music from virtually any website, and you don’t even need to be the owner of the site!

When you are the site owner

If you have a website and host directly downloadable MP3 files on your server, or link to MP3 files on your pages, then you can take advantage of Yahoo’s Media Player. All you have to do is add the following code to your pages

<script src = "http://mediaplayer.yahoo.com/js"></script>

Automatically, a small collapsible media player will appear at the bottom-left of the screen that will create a playlist of all MP3 files found on the page. Additionally, small play buttons appear in front of every MP3 links. This allows visitors to play media files directly on the site without having to download the files first.

yahoo-media-player

When you are not the site owner

Now obviously not every webmaster is aware of this service and might not have incorporated it on his site. There are two solutions to it:

1. Use a bookmarklet

Stoyan Stefanov has put together a few lines of code to build a bookmarklet. His bookmark however needs a little modification since it stopped working, probably because of changes in Yahoo’s codes. Another user has fixed it (in comments) and I’ve added the fix and created a new working bookmarklet. Drag this bookmarklet to your browser’s toolbar (or simply bookmark it). Now whenever you come across a site that has no embedded media player, just click on this bookmarklet and bingo! – Yahoo’s media player will pop open on your screen.

For some reason, this bookmarket is not working on Firefox but working fine in Opera. I haven’t tested it in IE.

2. Use a Greasemonkey script

Since the bookmarklet is having no effect on Firefox, use the Yahoo Media Player Greasemonkey script which is certainly better than a bookmarklet. This script will insert the media player on any website whenever it find playable MP3 files. Developer Scott has also created a Firefox addon, but I haven’t tried it.

Here is an example site to test your bookmarklet/script.

0 comments:

Post a Comment

Popular Posts