Matthew.Kalkman
2014-12-05T20:43:54Z
Hi,

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

Example:

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

I would like to use https://w.soundcloud.com...oud.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/(?<id>.*?)\[/SOUNDCLOUD\]

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

<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/{id}&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
Sponsor
tha_watcha
2014-12-06T17:55:19Z
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
File Attachment(s):
YafBBCodeSoundCloud.xml (2kb) downloaded 70 time(s).

UserPostedImage
Matthew.Kalkman
2014-12-08T21:41:16Z
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:

<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>

Can a BBcode be created to accept: 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  between the tags?
tha_watcha
2014-12-09T11:06:32Z
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]
UserPostedImage
Matthew.Kalkman
2014-12-10T14:28:33Z
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
2014-12-11T11:07:46Z
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]<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>[/soundcloud]

UserPostedImage

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved