Skip to the next or previous track

This code snippet will let you control the move along the queue of songs.

The Javascript

/* Instantiate the global sp object; include models */
var sp = getSpotifyApi(1);
var models = sp.require("sp://import/scripts/api/models");

var player = models.player;

$('#previous').click(function(){
    player.previous();
});

$('#next').click(function(){
    player.next();
});

The HTML

<input type="button" id="previous" value="« Previous" />
<input type="button" id="next" value="Next »" />

Live Example