Blog Posts

How to integrate RadioURL in your website

With Snowtape Beta 3 I started a new webservice called RadioURL.com. In its first stage RadioURL should be a service for shortening long URLs to all kinds of radio streams, Snowtape support. For example you can take a URL like this: http://scfire-ntc-aa05.stream.aol.com:80/stream/1074 and transform it into a URL like this: http://radiourl.com/eGj. All you have to do is go to RadioURL.com and transform the URL. When you click on the RadioURL URL, RadioURL checks if you have Snowtape installed and if that's the case it forwards the original URL to Snowtape.

How to detect if Snowtape is installed

For this detection to work, I created a Mozilla plugin called RadioURL.bundle which does nothing specific but registering the mime code "application/radiourl" in your web browser (Safari or Firefox). This plugin can be detected via Javascript:

function radioURLPlugInDetected()
{
    if (navigator.plugins && navigator.plugins.length > 0) {
        for (var i=0; i < navigator.plugins.length; i++ ) {
            var plugin = navigator.plugins[i];
            var pluginName = plugin.name;
            if (pluginName.indexOf("RadioURL Plugin V2") > -1 ||
            pluginName.indexOf("RadioURL Scheme Detector") > -1 ) {
                result = true;
            }
        }
    }
    return false;
}

How to transform a radio stream URL to a Snowtape URL

Snowtape registers for the URL scheme "radio://". When you click on such a URL, Snowtape is started and the URL gets delivered to it. Snowtape parses this URL and invokes appropriate methods. At this time it only responds to the "play" command. A valid URL, that can be processed by Snowtape looks like this:

radio://localhost/play?key=<optional>&stream=<original stream url>

The "key" parameter is optional and at this time only a hint for Snowtape which RadioURL.com entry was involved here. The imported part is the "stream" parameter. This is the original URL to the radio stream (url encoded).

How Snowtape is communicating with RadioURL.com

For Snowtape to be able to create RadioURL URLs inline, the RadioURL webservice also provides a small application API that can transform URLs and even handle internet playlist files. If you are interested in accessing this API in your application you can drop me an e-mail.

So if you like, you can now implement you own RadioURL.com service or if you are the managing director of a radio station, support Snowtape by using RadioURL.com or implement your own relocation service.

May 11th, 2009 • Permalink


More articles about Blog Posts

05/04/2013 - Tips and Tricks Part Three (Sharing and Accounts)
05/03/2013 - Instacast for Mac - Tips and Tricks Part Two (System Functions)
05/02/2013 - Instacast for Mac - Tips and Tricks Part One (Playback)
05/01/2013 - Instacast for Mac - Public Beta Available
01/23/2013 - Poodle Search Engine - Update
01/18/2013 - Poodle - An Experimental Search Engine for Podcasts
12/15/2012 - Integrate with Instacast
12/12/2012 - Instacast's Automatic Download Management
12/09/2012 - More about our Cloud Sync
12/06/2012 - Instacast 3.0 Available
09/13/2012 - Instacast Memberships