Check out this play button, written entirely it seems, using javascript: [spotify play button](https://developer.spotify.com/technologies/spotify-play-button/).

Notice that pressing play will cause Spotify to start playing music. OK, I figure that's done via some app-specific protocol link (like spotify://play), although I could be wrong. But the crazy part is that if you stop playing music in Spotify, the button will be updated in the browser to show that the music has stopped playing! How does that work?

You can look at its [source here](https://embed.spotify.com/?uri=spotify%3atrack:4bz7uB4edifWKJXSDxwHcs).