Skip to content

Instantly share code, notes, and snippets.

@ThisIsMissEm
Created December 19, 2011 08:21
Show Gist options
  • Save ThisIsMissEm/1496059 to your computer and use it in GitHub Desktop.
Save ThisIsMissEm/1496059 to your computer and use it in GitHub Desktop.
Least amount of code to get a playable spotify album cover within the context of a spotify app. Suggestions welcome.
var m = sp.require("sp://import/scripts/api/models"),
v = sp.require("sp://import/scripts/api/views"),
dom = sp.require('sp://import/scripts/dom');
var someContainer = dom.queryOne('.someClass');
m.Album.fromURI("spotify:album:2d7CiSgCNMiSjE9UG3sdTX", function(context){
var player = new v.Player();
player.context = context;
dom.adopt(someContainer, player.node);
});
@ThisIsMissEm
Copy link
Author

ThisIsMissEm commented Dec 21, 2011 via email

@nicklangridge
Copy link

Hi miksago,

Any idea how to modify this code to create an album player with large (200px x 200px) cover?

Thanks

@ThisIsMissEm
Copy link
Author

@Blnd Sorry, I don't know how to. Perhaps check the spotify documentation on this? Maybe check the CSS too, it might just be a large image returned by default then scaled down?

@nicklangridge
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment