This simple page demonstrates using the iLike HTML api to integrate songs into your web site. Please see the iLike Developer Dashboard for more information and to sign up.

Song player:

a song will render here momentarily...

Song chooser:

Choose a different song

Editable playlist:

a playlist will render here momentarily...
Click on one of the links below to set the mode that the playlist is in:
view add edit

The code to make this work:

<!-- include the iLike api script -->
<script src="http://www.ilike.com/api/js" ></script>

<script>
// set the developer key in a global variable so it doesn't have to be included
// in each function call
_iLikeDevKey = "****paste your Developer Key from http://www.ilike.com/developer****";

// this function will be called when the page loads to draw the intial song
// inside the div "song1"
iLikeDisplaySong({elId:"song1", songName:"Parsec", artistName:"Stereolab"});

// this is a callback function which receives a track from the song chooser dialog
// and updates the song display
function iLikeSongSelected(trackId) {
iLikeDisplaySong({elId:"song1", trackIds:trackId});
}

// this is a convenience function which draws the playlist in view, add, or edit mode
function showPlaylist(mode) {
iLikeDisplayPlaylist({elId:"playlist1", playlistName: "2", editMode: mode});
}

// render the playlist in view mode when the page loads
showPlaylist("view");

</script>

<!-- the main song display div (note that its id is passed to the api functions) -->
<div id="song1"></div>

<!-- clicking this link will launch the song chooser -->
<a href="#" onclick="iLikeSongChooser(); return false;">choose song</a>

<!-- the main playlist display div (note that its id is passed to the api functions) -->
<div id="playlist1"></div>

<!-- click on one of the links below to set the mode that the playlist is in -->
<a href="#" onclick='showPlaylist("view");return false;'>view</a>
<a href="#" onclick='showPlaylist("add");return false;'>add</a>
<a href="#" onclick='showPlaylist("edit");return false;'>edit</a>