Adding a Spotify Play Button to your blog, website, or social page enables all your fans to simply click Play and enjoy the music. You can create Play buttons for albums, tracks, artists, or playlists. When a logged-in Spotify user clicks the button, the music starts playing in the Spotify player. Playback can only be triggered by the user clicking the button. This means that:
- The Play button does not have any observable events, nor does it listen for any.
- Autoplay is not an option on the Play button widget
A Play button is effectively a “remote control” for the Spotify web client or the desktop client. To embed audio playback in your browser, use the Web Playback SDK. To embed audio playback in your mobile app, use the iOS or Android SDKs.
Make sure you have access to a web service that:
- Lets you link to external stylesheets, and
Premium or Free
For users who are not logged in on their Spotify account, the Spotify Play button plays a 30-second long audio preview, and then the users are prompted to either login or to sign up.
Play Button in Playlists
As of July 15th 2017 Play button tracksets are deprecated. Instead, we recommend that you use Spotify Play buttons for playlists. You can create playlists dynamically by using the Web API. This provides you with all the benefits involved in being fully integrated with all the Spotify clients. This also means that users can search for your playlists and subscribe to them. Any changes you make to a playlist will be synchronized with your Spotify Play button within 10 minutes (max). Playlists cannot be shuffled. Users can select “Shuffle” in their player after they press the Play button. Local files in playlists are not shown in the Play button widget.
On display you see only the first 200 tracks in any playlist. A user’s playlist of starred tracks is currently not available. The displayed order is the one in which they are arranged in the playlist for regular playlists, and the order in which they were added in the case of a user’s starred playlist. To sort your regular playlists differently, you can for example, open the Spotify Desktop Player and drag-and-drop your tracks into the order you require. Alternatively, you can programmatically reorder tracks through the Spotify Web API. See the endpoint for reordering tracks in a playlist.
You can choose different button themes and sizes. You may also link the button to any song or album in the Spotify music Catalog, or to any playlist that you have created. To do that verify the Terms of Service you need to comply with. Currently you cannot change the Follow button design
To Add a Spotify Play Button
As with the Follow button widget, get the Spotify HTTP link for the code generator.
- Get the album link from the Spotify Desktop Player for the album called Kernel Panic EP, and then paste it into the generator.
- Copy the Play Button embed code and paste it into your HTML file just above the code for the Follow Button.
- After saving your code take a look at it in a browser window; it should look like this:
- Seeking within a track is not supported by the Play Button.
- In Chrome versions 64+, Spotify Play Button needs its iframes to have
allow="encrypted-media"for reliable playback. If your embed code was generated before March 2018, it may be missing this. You can regenerate your play button embed code here.