XF 1.5 Soundcloud BB Code

fattony69

Well-known member
I am trying to create a BB Code for Soundcloud and I ran into an issue. There are multiple embeds for similar things, but I am not sure whether or not they require separate BB Codes or rather just one using Regrex. I'll show it below.

There are four types of links (at least that I am aware of):
  • Public link
  • Private link
  • Public Set
  • Private Set
I want to make it so that you can post any and there will be no issue. Here is what the links and the embed code look like.

Public link with embed
Code:
https://soundcloud.com/edmassassin/anonymous-controlled-demolition-original-mix-download-version/s-ueMHc
Code:
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/172358598%3Fsecret_token%3Ds-ueMHc&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>

Private link with embed
Code:
https://soundcloud.com/edmassassin/anonymous-controlled-demolition-original-mix-free-download
Code:
<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/172358416&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>

Public set with embed
Code:
https://soundcloud.com/edmassassin/sets/martin-garrix-top-10
Code:
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/16832803&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>

Private set with embed
Code:
https://soundcloud.com/edmassassin/sets/martin-garrix-top-10/s-0K24d
Code:
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/16832803%3Fsecret_token%3Ds-0K24d&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>

Thanks for the help!
 
Based on the embed code, there isn't enough information in the URL to generate the embed code from it. You would likely need custom PHP callbacks to pick out the correct identifiers for the embed code from the page.

At the least, the sets/playlists and the links/tracks would need to be separate media sites. With and without the identifier could be handled together, but you'd need custom PHP to generate the necessary output as well.
 
Top Bottom