A way to control play/pause, and get notified of song completion when using the iframe embed would be very helpful!
For example, I'm embedding a Spotify song using the instructions from the docs :
<iframe scrolling="no" allow="autoplay" src="https://open.spotify.com/embed/track/16HPj2zrjdSXCH5SGf0NY0?si=2584d6594f65412a" frameborder="no"></iframe>
For reference, YouTube (docs) and SoundCloud (docs) both support extensive APIs for this.
The simplest option might be to add embedly/player.js , which has an adapter for HTML Video elements which handles everything:
const video = document.getElementById('video');
video.load();
const adapter = playerjs.HTML5Adapter(video);
// Start accepting events
adapter.ready();
Then the parent site can pause, play, and be notified of playback ending!
I too want this feature very badly!
Updated on 2022-02-07
Hello!
Your idea has been submitted a while ago but unfortunately hasn't gathered enough kudos yet. In order to keep an overview of the active ideas in this forum, we will close this idea for now. However, this does not mean that your idea has been declined by Spotify.
If you still feel strongly about your request, we encourage you to continue sharing it to get more kudos. Folks can still add their votes and comments in order to support it.
Do you have any further questions on how the idea exchange is managed? Just click here.
Updated on 2021-11-09
Hello and thanks for submitting your idea to the Idea Exchange!
We've gone ahead and marked this as a New Suggestion. Spotify Staff will look into this idea once it reaches the necessary amount of votes.
You might also be interested in voting for some related ideas that have already been suggested:
More info on how your feedback reaches Spotify via the Idea Exchange can be found here.