I'm happy to share with you a new API for playing music on your site. We call it simple.js, because that's where you find it: http://www.rhapsody.com/simple.js. This API lets your web pages trigger music playback without requiring your visitors to leave your site. In places where you can include javascript, simple.js will start a track or album playing in the web popup player window without navigating off your page. Much like a RhapLink, it will re-use an existing web popup player window if it's already open, or open a new one if needed. Plugin detection/install and login are all handled for you. As the name implies, a goal of simple.js is to be as simple to use as possible. Consider this example:
<script src="http://www.rhapsody.com/simple.js" />
<a href="javascript:RhapsodyPlayer.playTrack(2899985);"> Listen to Cake's "Stickshifts and Safetybelts" on Rhapsody.com</a>
Which renders as:
Pretty straightforward, eh? The only tricky part is finding the RCID value of the track, in this case 2899985. We've been working hard to remove obscure database IDs from the site, and they're almost completely gone fom the URLs. But you can find them in the RSS feeds. In this case, open http://feeds.rhapsody.com/cake/fashionnugget/tracks.rss and look at the <guid> field -- that's the RCID value you need to pass to simple.js. We've got some other ways to find RCIDs in the works that you'll hear about soon.
As always, feedback on the API is most welcome.
-Leo Parker Dirac
Recent Comments