Created
April 21, 2017 21:07
-
-
Save JMPerez/a9f7997a19cabe0c7151f3e6247f92d7 to your computer and use it in GitHub Desktop.
An example of how to use the spotify-player wrapper
This file contains hidden or 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
<html> | |
<body> | |
<script src="https://spotify-player.herokuapp.com/spotify-player.js"></script> | |
<script> | |
var spotifyPlayer = new SpotifyPlayer(); | |
spotifyPlayer.on('update', response => { | |
// render the track received | |
}); | |
spotifyPlayer.on('login', user => { | |
if (user === null) { | |
// no user | |
} else { | |
// say hello to the user, and tell them to play something! | |
} | |
}); | |
spotifyPlayer.init(); | |
spotifyPlayer.login(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment