Is it possible to set up an automatic spotify player iframe from spotify link?

If your Discourse site is self-hosted, I think the best approach would be to create a Spotify onebox plugin. If you open your web inspector on a Spotify page, you’ll see that the data you would need to create a Spotify player from an iframe exists in the page’s meta tags. You probably need to use key commands to open your web inspector. Spotify seems to block right clicks.

You can find examples of how oneboxes are created here: GitHub - discourse/onebox: (DEPRECATED) A gem for turning URLs into website previews.

3 Likes