YAFLogo

Matthew.Kalkman
7 years ago
Hi,

I am trying to create BB Code for embedding SoundCloud audio streaming.

Example:

https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/176533020  from the frame src to embed the track in a post.

I can get the RegEx to recognize it as soundcloud with the search RexEx:

\[SOUNDCLOUD\]https://w.soundcloud.com/player/\?url=https%3A//api.soundcloud.com/tracks/(?.*?)\[/SOUNDCLOUD\]

I cannot, however, get the id into the replacement RegEx using the replace variable "id":

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
7 years ago
simply use "inner" instead of "id" or if you want to use "id" you need to enter id in the Replace Variables field.

i attached my version of the SoundCloud BBCode Extension

Matthew.Kalkman
7 years ago
Thanks watcha.

However, I am still having issues with SoundCloud private tracks. These cannot be accessed with the share URL.

Private tracks CAN be embedded however. Therefore my question is can a BBcode be used with the src value from the embed code?

For the example track, the embed code is:

Can a BBcode be created to accept: https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/871&color=ff5500&inverse=false&auto_play=false&show_user=true  between the tags?

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
7 years ago
try my version of the bbcode all you enter is

[soundcloud]http://soundcloud.com/forss/speech-craft-no-sleep-til-dawn-remix-by-forss[/soundcloud]

Matthew.Kalkman
7 years ago
Unfortunately your version does not work with private sound tracks. That is why I would like to get the src from the embed code to work with the BB code. Is that possible?
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 3.0.3
7 years ago
Well if that is the embed code for the private track

<iframe width="100%" height="20" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/871&amp;color=ff5500&amp;inverse=false&amp;auto_play=false&amp;show_user=true"></iframe>

then simply use

[soundcloud]https://api.soundcloud.com/tracks/871[/soundcloud]

Or you extend the bbcode to allow pasting in the embed code itself by using this search regex

\[soundcloud\](?<inner>.+?)\[/soundcloud\]|\[soundcloud\]\<iframe.*?src=\"https://w.soundcloud.com/player/\?url=(?<inner>.*?)&amp;.*?\".*?\>\<\/iframe\>\[/soundcloud\]

then you can use

[soundcloud][/soundcloud]