AbstractSpotifyService

AbstractSpotifyService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:
Properties

NameTypeDescription
isPausedboolean

true if spotify is paused

AbstractSpotifyService()

Service managing the Spotify Connect feature

setActiveState(active) ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
activeBoolean

true to establish connection, false to disconnect

getActiveState() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true if STB is the active playback device

setShuffle(shuffle) ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
shuffleBoolean

true to activate shuffle, false to deactivate

isShuffleOn() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true if shuffle mode is on

setRepeatMode(repeatMode) ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
repeatModeString

disabled, repeat_context or repeat_track

getRepeatMode() ⇒ Promise.<String>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<String> - - promise value will be disabled, repeat_context or repeat_track

getTrackMetadata(relativeIndex) ⇒ Promise.<Object>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Object> - - promise value is the requested metadata object

ParamTypeDescription
relativeIndexNumber

target track index, relative to the current track, default value is 0 (current track)

playTrack() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

pauseTrack() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

nextTrack() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

previousTrack() ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

seekInTrack(offset) ⇒ Promise.<Boolean>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
offsetNumber

time in ms to seek forward in the track, negative values will seek backwards

getTrackPosition() ⇒ Promise.<Number>

Kind: instance method of AbstractSpotifyService
Returns: Promise.<Number> - - promise value will be time elapsed in ms in current track

_setActiveState(active) ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
activeBoolean

true to establish connection, false to disconnect

_getActiveState() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true if STB is the active playback device

_setShuffle(shuffle) ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
shuffleBoolean

true to activate shuffle, false to deactivate

_isShuffleOn() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true if shuffle mode is on

_setRepeatMode(repeatMode) ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
repeatModeString

disabled, repeat_context or repeat_track

_getRepeatMode() ⇒ Promise.<String>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<String> - - promise value will be disabled, repeat_context or repeat_track

_getTrackMetadata(relativeIndex) ⇒ Promise.<Object>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Object> - - promise value is the requested metadata object

ParamTypeDescription
relativeIndexNumber

target track index, relative to the current track, default value is 0 (current track)

_playTrack() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

_pauseTrack() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

_nextTrack() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

_previousTrack() ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

_seekInTrack(offset) ⇒ Promise.<Boolean>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Boolean> - - promise value will be true on success

ParamTypeDescription
offsetNumber

time in ms to seek forward in the track, negative values will seek backwards

_getTrackPosition() ⇒ Promise.<Number>

Kind: instance abstract method of AbstractSpotifyService
Returns: Promise.<Number> - - promise value will be time elapsed in ms in current track

_onConnectRequest() ⇒ Promise.<void>

Dispatch Spotify Connect request

Kind: instance method of AbstractSpotifyService
Access: protected

_onSpotifyActive() ⇒ Promise.<void>

Dispatch Spotify becoming active

Kind: instance method of AbstractSpotifyService
Access: protected

_onSpotifyInactive() ⇒ Promise.<void>

Dispatch Spotify becoming inactive

Kind: instance method of AbstractSpotifyService
Access: protected

_onShuffle(active) ⇒ Promise.<void>

Dispatch Spotify shuffle mode changing

Kind: instance method of AbstractSpotifyService
Access: protected

ParamTypeDescription
activeBoolean

true if shuffle mode turned on, false if turned off

_onRepeat(mode) ⇒ Promise.<void>

Dispatch Spotify repeat mode changing

Kind: instance method of AbstractSpotifyService
Access: protected

ParamTypeDescription
modeString

disabled, repeat_context or repeat_track

_onLostPermission() ⇒ Promise.<void>

Dispatch device losing Spotify playback permission

Kind: instance method of AbstractSpotifyService
Access: protected

_onPlay() ⇒ Promise.<void>

Dispatch Spotify starting or resuming playback

Kind: instance method of AbstractSpotifyService
Access: protected

_onPause() ⇒ Promise.<void>

Dispatch Spotify pausing playback

Kind: instance method of AbstractSpotifyService
Access: protected

_onTrackChanged(metadata) ⇒ Promise.<void>

Dispatch Spotify track changing

Kind: instance method of AbstractSpotifyService
Access: protected

ParamTypeDescription
metadataSpotifyTrack

New metadata after it has changed

_onSeek(position) ⇒ Promise.<void>

Dispatch Spotify seeking new position in its track

Kind: instance method of AbstractSpotifyService
Access: protected

ParamTypeDescription
positionNumber

New position in the current track (in ms)

“connectRequest”

When a device is asking to become the active playback device

Kind: event emitted by AbstractSpotifyService

“spotifyActive”

When the device is set as active playback device

Kind: event emitted by AbstractSpotifyService

“spotifyInactive”

When the device is not the active playback device anymore

Kind: event emitted by AbstractSpotifyService

“shuffle”

When the Spotify shuffle mode is turned on or off

Kind: event emitted by AbstractSpotifyService

“repeat”

When the Spotify repeat mode is changed or turned off

Kind: event emitted by AbstractSpotifyService

“lostPermission”

When the device is set as active playback device

Kind: event emitted by AbstractSpotifyService

“play”

When the playback has started or resumed

Kind: event emitted by AbstractSpotifyService

“pause”

When the playback has been paused

Kind: event emitted by AbstractSpotifyService

“trackChanged”

When the current track or its metadata has changed

Kind: event emitted by AbstractSpotifyService

“seek”

When the playback position in the track has changed

Kind: event emitted by AbstractSpotifyService