https://github.com/bengreenier-archive/spotify-playbutton
act like the spotify playbutton from node
https://github.com/bengreenier-archive/spotify-playbutton
Last synced: 3 months ago
JSON representation
act like the spotify playbutton from node
- Host: GitHub
- URL: https://github.com/bengreenier-archive/spotify-playbutton
- Owner: bengreenier-archive
- License: mit
- Created: 2015-10-25T04:46:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-02T01:21:32.000Z (over 9 years ago)
- Last Synced: 2024-12-26T00:40:20.705Z (5 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
spotify-playbutton
=================Expose the SDK behind the spotify play button widget to node
# How
Some scary shit. We EVAL the official spotify client with enough
shims to make it run.`npm install spotify-playbutton`. `require('spotify-playbutton')({SSL:true})`
will return a promise that resolves to a SpotifyRemote. See [API](#API).# API
> SpotifyRemote is the __undocumented__ official spotify playbutton API.
## init(token, unknown, unknown, options)
We call this for you before we yield the promise.
It sets things up and connects to the local spotify client.## playSpotifyURI(uri)
plays a thing in the client
## openSpotifyURI(uri)
opens a thing in the client
## playPauseCurrent
toggles play/pause
## pause
just pauses
## getCurrentTrack
gets the current track
## isClientRunning
is spotify desktop open?
## isTrackPlaying
is spotify playing a track?
## getCurrentURI
get the spotify:uri of the current track
## getIdentifier
returns `desktop-client`
## ??
There is more that I haven't played with yet.
I find printing the initialized SpotifyRemote instance to the console to be the best way to find functionality.# License
Who the fuck knows - my code is MIT but this might void some spotify TOS
or something. I wouldn't advise using it in code you want to keep owning.