Skip to content

Connecting Hardware Buttons

Warning:Commercial Hardware tools and the eSDK are available only for approved partners

If the device has hardware buttons for things like "Play", "Pause", "Skip Track", etc., the application should use SpPlaybackXXX() functions to perform these actions in the Spotify Embedded SDK. The following table shows which functions exist and it also lists the corresponding callbacks and "getter" functions.

Play SpPlaybackPlay() kSpPlaybackNotifyPlay SpPlaybackIsPlaying()
Pause SpPlaybackPause() kSpPlaybackNotifyPlay SpPlaybackIsPlaying()
Skip to next track SpPlaybackSkipToNext() kSpPlaybackNotifyPlay N/A
Skip to previous track SpPlaybackSkipToPrev() kSpPlaybackNotifyPlay N/A
Seek SpPlaybackSeek() SpCallbackPlaybackSeek() SpPlaybackGetPosition()
Volume SpPlaybackUpdateVolume() SpCallbackPlaybackApplyVolume() SpPlaybackGetVolume()
Shuffle SpPlaybackEnableShuffle() kSpPlaybackNotifyShuffleOn, kSpPlaybackNotifyShuffleOff SpPlaybackIsShuffled()
Repeat SpPlaybackEnableRepeat() kSpPlaybackNotifyRepeatOn, kSpPlaybackNotifyRepeatOff SpPlaybackIsRepeated()

Note: If the user is playing on another Connect-enabled device, the function SpPlaybackPlay will pull playback to the device. This way, pressing the "Play" button on the device has the same effect as pushing playback to the device by using the Spotify mobile app. The device will become the active device.