Play song IN Spotify from a button on a website - spotify

Just wondering if this following process is possible with Spotify API:
Let's assume I have a apply button on my website, if I click on this button, can I play a song in Spotify (not through the embedded Spotify player)

Related

How to redirect user to the playlist from the click of spotify button without the need to log in?

I am using Spotify Widget and the embeded code is
<-iframe src="https://embed.spotify.com/?uri=spotify:user:erebore:playlist:788MOXyTfcUb1tdw4oC7KJ&view=coverart" width="292" height="80" frameborder="0" allowtransparency="true"></iframe>
There is an option for embeded code where you can show the playlist like,
<-iframe src="https://embed.spotify.com/?uri=spotify:user:erebore:playlist:788MOXyTfcUb1tdw4oC7KJ" width="250" height="80" frameborder="0" allowtransparency="true"></iframe>
But due to size limitation we cannot use this code.
I would like to have the ability for users on my site to click the Spotify button on my homepage and be directed straight to playlists I have chosen. Right now, I can only see one song at a time and if I click the Spotify icon
it just take me to the home page of Spotify and invites me to register or log in. Is there an easier way to direct my users straight to the music I've chosen for the theme of my website?
Thanks
I'm a bit unsure of how you exactly want it to look and work but you can always link to the open pages, here is an example (that will send the user to the open.spotify.com site tho):
http://open.spotify.com/user/spotify/playlist/1GQLlzxBxKTb6tJsD4RxHI
The playlist will start playing if you have the spotify desktop app open.
You can get an open link for any playlist in the Spotify client by pressing the (...) button in the header of a playlist and pick "copy http url".

Is it possible to control the spotify desktop client from a browser with custom controls?

I am a developer for playmoss where users can create playlists with different music services.
We are planning on adding Spotify support to our playlists in a way similar to what bop.fm does.
Context
Taking for example this playlist (in which all songs are available on spotify, at least in Spain)…
https://bop.fm/p/o12l
…if we have the spotify client installed in our computer (tested with a Mac)
As soon as the playlist starts playing we can click the spotify icon on the top right [picture]and we will be playing the songs through spotify.
Using the bop.fm control interface we can pause, play, skip next, even skip to a point in the track with progress bar.
This is similar but even more powerful than the official spotify play button, see an example here:
http://jsfiddle.net/insonorizate/a5jf39yn/
With the play button there is previous, play, pause, next functionality but not seek.
Of course it can not be customized in any way nor called from javascript.
(in bop.fm is possible to open a debuger console and call
Bop.Player.pause()
or
Bop.Player.play()
to pause or play the track beeing played in bop.fm via spotify)
Fiddling a little with the bop.fm page there are some interesting things. Ther is an iframe in the main page poiting to:
https://embed.spotify.com/remote-control-bridge/
Viewing this iframe source we find something like this:
// Expose the OAuth Token to the Javascript
var tokenData = 'NAowChgKB1Nwb3RpZnkSABoGmAEByAEBJReQCFQSFG2Ynvz1oBKgxv2mE1XXz_1Au-cg';
// Pass the remote control to the bridge
var remoteControlBridge = new Spotify.RemoteControlBridge();
remoteControlBridge.init(tokenData);
There's no documentation for Spotify.RemoteControlBridge (0 results for "Spotify.RemoteControlBridge" on google) and there isn't any thing in the documentation of the different apis even close to controling the spotify player in a way similar to this.
Question
How can I control the spotify desktop app from a browser?
Does bop.fm have any special arrangment with spotify and they are using some "secret api"?
Are they exploiting some functionality that I fail to find?
Is it possible to replicate it?
Is it in accordance with the Spotify terms?
Thanks!
You can't control the Spotify Client or Listen to Events the Spotify Web Helper is emitting. Imagine everybody could: every website could potentially play a song without your permission or even know instantly what you are listening to. To prevent this Spotify only allows approved partners to use this feature.
As you figured out the remote-control-bridge provides this functionality. It can communicate with the Spotify Web Helper running on your system, which is secured by an OAuth and a CSRF Token. In the remote-control-bridge you even can see the allowed partners:
Spotify (who knew)
Yahoo
last.fm
coachella.com
bop.fm
sandpit.us
echonest
musixmatch
You can contact them and ask for a partnership. I'm sure they won't bite.
This is actually a little bit documentated on the website of Spotify in the developers section.
I think bop.fm does use their custom Spotify Play Button widget. That makes use of the iframe that you mentioned.
Here you can find the documentation about this functionality of Spotify. You can then modify it to your own needs using Javascript etc.

Embed YouTube videos in thirdparty player

Is there any website video player that I can embed YouTube videos in that also displays a playlist?
I want to be able to see the playlist and as far as I know the YouYube provided player that allows for playlists doesn't show the list unless you click on the playlist button in the top left. I want something with a playlist under or beside the video window that shows at all times.
youtube uses an iframe (as simple as that) to deliver content. Any website can display youtube playlists if the url in the "embed code" has the variables to do that. I forget the url but I am sure it is possible. I hope I got your question right...

spotify apps javascript crossfading

How to achieve crossfading on a Spotify javascript based app?
I'm creating a temp playlist and adding songs to it on the fly, the added song plays but doesn't crossfade.
EDIT: I guess the real question is how to cause Spotify to do a refresh of the play queue. the added songs get added to the visible play queue only on the track change, which makes it not crossfade.
There is currently no programmatic access to crossfading in a spotify app (https://developer.spotify.com/technologies/apps/docs/beta/f19ff300f8.html)
However, if the user has crossfading enabled (Settings->Playback->Crossfade tracks) and the model.Player is playing from a context with multiple tracks (like a Playlist or Album) then crossfading should kick in.
The caveat here is that you have to have the next song in the playlist added early-on enough so that the client has time to recognize the change in the playlist. One way to verify if you're adding this in time is to ensure the 'Play Queue' shows that it will play the next song in your playlist.

Spotify Play Button - autoplay?

I am trying to integrate Spotify Play Button into ThingLink Spotify tag so that when the iframe loads, it starts playing automatically. Is there a way to do that with some parameter?
The functionality would be similar to Soundcloud & Vimeo players here:
http://www.thinglink.com/scene/251225958915244034
Without the autoplay, user would have to click on Play twice, which wouldn't be that good of UX.
Thanks!
-Albert
There is no autoplay functionality at present.
Autoplay isn't really what the Play Button is about — it's designed so people can listen to music if they want to. We don't really want to interrupt whatever the user is listening to already (be it something in Spotify, something else, or silence) without express permission to do so first.

Resources