Support for Apple Music Embed Code

I don’t know how difficult it is to implement but it would be nice to have support for embedding albums from Apple Music, esp. for threads like “What are you listening to?”. Seems to work well for Spotify plus it looks neat.

Thoughts?

2 Likes

I’ll into this if it’s doable. Can you give me an example link to embed?

2 Likes

When you go to share → copy embed link on an Apple Music album, it looks like this:

<iframe allow="autoplay *; encrypted-media *;" frameborder="0" height="450" style="width:100%;max-width:660px;overflow:hidden;background:transparent;" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation" src="https://embed.music.apple.com/de/album/home-alone/1506560848"></iframe>

Looks like Apple Music links work differently from Spotify ones. I have whitelisted both origins and Discourse can parse a Spotify link just fine whereas you have to embed an entire iframe HTML code manually for an Apple Music link to work.

Technically, it’s doable by using such an HTML code above as you can do on your website. But for security purposes, we do not allow any user to dangerously inject HTML code into a post. I wish it worked just like Spotify though.

If Apple Music links work like Spotify in the future, I’ll surely look into this again. Thanks a lot for your feedback!

3 Likes

Bummer… but understandable from a technical point of view. Thank you for looking into it, though, I appreciate it!

1 Like

No problem! Thanks for your suggestion too.