I want to gratulate you to this wonderful library. I use it together with smartgwt and it works fine (btw: I derived my own player interface using smartgwt Progressbar).
Price is moderate (5 € per month) and you get legal access to over 10.000.000 titles of music of all styles.
I suggest that you add support for rdio to the best player.
to help you get started I wrote a small script that shows how to access the player
// a global variable that will hold a reference to the api swf once it has loaded
var apiswf = null;
var advanceToTrack=false;
var advanceToPosition=false;
$(document).ready(function() {
// on page load use SWFObject to load the API swf into div#apiswf
var flashvars = {
'playbackToken': "GAlPc2Nt_____... request your personal token from rdio and fill in here ",
'listener': 'rdioListener' // the global name of the object that will receive callbacks from the SWF
}
var params = {
'allowScriptAccess': 'always'
};
var attributes = {};
'apiswf', // the ID of the element that will be replaced with the SWF
1, 1, '9.0.0', 'expressInstall.swf', flashvars, params, attributes);
// set up the controls
$('#play').click(function() {
apiswf.rdio_play($('#play_key').val());
advanceToTrack = true;
$('#blocked').hide();
});
$('#stop').click(function() { apiswf.rdio_stop(); });
$('#pos0').click(function() { apiswf.rdio_seek(0); });
$('#pos20').click(function() { apiswf.rdio_seek(20); });
$('#pos50').click(function() { apiswf.rdio_seek(50); });
$('#pause').click(function() { apiswf.rdio_pause(); });
});
// the global callback object
var rdioListener = {};
rdioListener.ready = function ready(user) {
// Called once the API SWF has loaded and is ready to accept method calls.
// find the embed/object element
apiswf = $('#apiswf').get(0);
}
rdioListener.playStateChanged = function playStateChanged(playState) {
// The playback state has changed.
// The state can be: 0 - paused, 1 - playing, 2 - stopped, 3 - buffering or 4 - paused.
switch (playState) {
case 0: $('#playState').text("paused"); break;
case 1: $('#playState').text("playing"); break;
case 2: $('#playState').text("stopped"); break;
case 3: $('#playState').text("buffering"); break;
case 4: $('#playState').text("paused"); break;
}
if (advanceToTrack==true && playState==1) {
// select desired track
var trackNo = parseInt($('#track_key').val());
apiswf.rdio_setCurrentPosition(trackNo-1); // zero based numbers
advanceToTrack=false;
advanceToPosition=true;
}
else if (advanceToPosition==true && playState==1) {
var position = parseFloat($('#position_key').val());
apiswf.rdio_seek(position); // zero based numbers
advanceToPosition=false;
}
}
rdioListener.playingTrackChanged = function playingTrackChanged(playingTrack, sourcePosition) {
// The currently playing track has changed.
// Track metadata is provided as playingTrack and the position within the playing source as sourcePosition.
if (playingTrack != null) {
$('#track').text(playingTrack['name']);
$('#album').text(playingTrack['album']);
$('#artist').text(playingTrack['artist']);
$('#icon').attr('src', playingTrack['icon']);
$('#duration').text(playingTrack['duration']);
$('#key').text(playingTrack['key']);
}
}
rdioListener.playingSourceChanged = function playingSourceChanged(playingSource) {
// The currently playing source changed.
// The source metadata, including a track listing is inside playingSource.
}
rdioListener.positionChanged = function positionChanged(position) {
//The position within the track changed to position seconds.
// This happens both in response to a seek and during playback.
$('#position').text(position);
}
rdioListener.playingSomewhereElse = function playingSomewhereElse() {
// An Rdio user can only play from one location at a time.
// If playback begins somewhere else then playback will stop and this callback will be called.
$('#blocked').show();
}
=======================================================================================================