docs » hs.spotify
Controls for Spotify music player
- Constants - Useful values which cannot be changed
- state_paused
- state_playing
- state_stopped
- Functions - API calls offered directly by the extension
- displayCurrentTrack
- ff
- getCurrentAlbum
- getCurrentArtist
- getCurrentTrack
- getCurrentTrackId
- getDuration
- getPlaybackState
- getPosition
- getVolume
- isPlaying
- isRunning
- next
- pause
- play
- playpause
- playTrack
- previous
- rw
- setPosition
- setVolume
- volumeDown
- volumeUp
Signature | hs.spotify.state_paused |
---|---|
Type | Constant |
Description | Returned by hs.spotify.getPlaybackState() to indicates Spotify is paused |
Signature | hs.spotify.state_playing |
---|---|
Type | Constant |
Description | Returned by hs.spotify.getPlaybackState() to indicates Spotify is playing |
Signature | hs.spotify.state_stopped |
---|---|
Type | Constant |
Description | Returned by hs.spotify.getPlaybackState() to indicates Spotify is stopped |
Signature | hs.spotify.displayCurrentTrack() |
---|---|
Type | Function |
Description | Displays information for current track on screen |
Parameters |
|
Returns |
|
Signature | hs.spotify.ff() |
---|---|
Type | Function |
Description | Skips the playback position forwards by 5 seconds |
Parameters |
|
Returns |
|
Signature | hs.spotify.getCurrentAlbum() |
---|---|
Type | Function |
Description | Gets the name of the album of the current track |
Parameters |
|
Returns |
|
Signature | hs.spotify.getCurrentArtist() |
---|---|
Type | Function |
Description | Gets the name of the artist of the current track |
Parameters |
|
Returns |
|
Signature | hs.spotify.getCurrentTrack() |
---|---|
Type | Function |
Description | Gets the name of the current track |
Parameters |
|
Returns |
|
Signature | hs.spotify.getCurrentTrackId() |
---|---|
Type | Function |
Description | Gets the id of the current track |
Parameters |
|
Returns |
|
Signature | hs.spotify.getDuration() |
---|---|
Type | Function |
Description | Gets the duration (in seconds) of the current song |
Parameters |
|
Returns |
|
Signature | hs.spotify.getPlaybackState() |
---|---|
Type | Function |
Description | Gets the current playback state of Spotify |
Parameters |
|
Returns |
|
Signature | hs.spotify.getPosition() |
---|---|
Type | Function |
Description | Gets the playback position (in seconds) in the current song |
Parameters |
|
Returns |
|
Signature | hs.spotify.getVolume() |
---|---|
Type | Function |
Description | Gets the Spotify volume setting |
Parameters |
|
Returns |
|
Signature | hs.spotify.isPlaying() |
---|---|
Type | Function |
Description | Returns whether Spotify is currently playing |
Parameters |
|
Returns |
|
Signature | hs.spotify.isRunning() |
---|---|
Type | Function |
Description | Returns whether Spotify is currently open. Most other functions in hs.spotify will automatically start the application, so this function can be used to guard against that. |
Parameters |
|
Returns |
|
Signature | hs.spotify.next() |
---|---|
Type | Function |
Description | Skips to the next Spotify track |
Parameters |
|
Returns |
|
Signature | hs.spotify.pause() |
---|---|
Type | Function |
Description | Pauses the current Spotify track |
Parameters |
|
Returns |
|
Signature | hs.spotify.play() |
---|---|
Type | Function |
Description | Plays the current Spotify track |
Parameters |
|
Returns |
|
Signature | hs.spotify.playpause() |
---|---|
Type | Function |
Description | Toggles play/pause of current Spotify track |
Parameters |
|
Returns |
|
Signature | hs.spotify.playTrack(id) |
---|---|
Type | Function |
Description | Plays the Spotify track with the given id |
Parameters |
|
Returns |
|
Signature | hs.spotify.previous() |
---|---|
Type | Function |
Description | Skips to previous Spotify track |
Parameters |
|
Returns |
|
Signature | hs.spotify.rw() |
---|---|
Type | Function |
Description | Skips the playback position backwards by 5 seconds |
Parameters |
|
Returns |
|
Signature | hs.spotify.setPosition(pos) |
---|---|
Type | Function |
Description | Sets the playback position in the current song |
Parameters |
|
Returns |
|
Signature | hs.spotify.setVolume(vol) |
---|---|
Type | Function |
Description | Sets the Spotify volume setting |
Parameters |
|
Returns |
|
Signature | hs.spotify.volumeDown() |
---|---|
Type | Function |
Description | Reduces the volume by 5 |
Parameters |
|
Returns |
|
Signature | hs.spotify.volumeUp() |
---|---|
Type | Function |
Description | Increases the volume by 5 |
Parameters |
|
Returns |
|