2007年 01月 30日 火曜日 00:50
Hey, so here's some HTML you can add to a site to get the last.fm radio on it.
Note: you'll need to specify the last.fm station you want the radio to play. There are two places this information goes in the HTML, both are marked below as "". Replace that with the appropriate information.
Here are some examples of appropriate information:
group/
user//personal
user//loved
user//neighbours
globaltags/
<script type="text/javascript" src="http://static2.last.fm/jsr/11/prototype.js"></script>
<script type="text/javascript" src="http://static2.last.fm/jsr/11/main.js"></script>
<script type="text/javascript">
function notifyOpener()
{
if(self.opener && !self.opener.radioPopup) self.opener.radioPopup = self;
}
function tune(radioURL)
{
var radio = getPlayerEl('lfmPlayer');
radio.SetVariable("radioURL",radioURL);
radio.TCallLabel("/", "HandleJSTuning");
}function setPopupTitle(title)
{
$("radioTitle").innerHTML = 'Listening to ' + unescape(title);
}
function handleError() { return true; }
window.onerror = handleError;
setInterval(notifyOpener,2000);
</script>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="340" height="120" id="lfmPlayer" align="middle"><param name="allowScriptAccess" value="always" />
<param name="movie" value="http://static.last.fm/webclient/30/defaultEmbedPlayer.swf" />
<param name="FlashVars" value="lang=en&popup=true&lfmMode=radio&radioURL=lastfm://" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="wmode" value="transparent" />
<param name="swLiveConnect" value="true" />
<embed src="http://static.last.fm/webclient/30/defaultEmbedPlayer.swf" quality="high" bgcolor="#FFFFFF" width="340" FlashVars="lang=en&popup=true&lfmMode=radio&radioURL=lastfm://" height="120" wmode="transparent" name="lfmPlayer" swLiveConnect="true" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>