Created
December 19, 2011 08:21
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
Author
ThisIsMissEm
commented
Dec 21, 2011
via email
Hi Nick,
You'll probably need to load in the eve style sheet and shared. I have:
```
<link rel="stylesheet" href="sp://import/css/adam.css">
<link rel="stylesheet" href="sp://import/css/api.css">
```
In my html file.
Hopefully this helps, let me know other wise.
Regards,
Micheil
…On 21 Dec 2011, at 13:01, Nick Langridge wrote:
If I try this code I don't see the album cover, just a grey button - maybe I need to load a specific stylesheet first?
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/1496059
Hi miksago,
Any idea how to modify this code to create an album player with large (200px x 200px) cover?
Thanks
@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?
I got it working - see here for details http://stackoverflow.com/questions/11718663/how-can-i-make-a-large-album-player-using-spotify-apps-api
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment