1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SoundCloud Embed

Discussion in 'XenForo Questions and Support' started by Acelondoner, Apr 8, 2012.

  1. Acelondoner

    Acelondoner Member

    I have a forum which uses phpbb currently. I plan on switching to xenforo using the phpbb importer. My phpbb board currently has 100's of soundcloud embeds as people like to show their music.

    Does the importer convert over bbcodes? I would like all the soundcloud embeds to get transfered over to the new forum. If the importer doesn't do this then can it be achieved another way?

    This is the only thing that is holding me back from buying this forum software right now so if it's possible, you have a sale.

    Cheers, Ace.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    RobinHood and ArnyVee like this.
  3. Acelondoner

    Acelondoner Member

    Here is the code I used in phpbb:

    BBCode Usage:


    HTML replacement:

    <object height="81" width="100%"><param name="movie" value="http://player.soundcloud.com/player.swf?url={URL}&amp;g=bb"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url={URL}&amp;g=bb" type="application/x-shockwave-flash" width="100%"></embed></object> <a href="{URL}">{URL}</a>

    Help Line:

    Embed the tracks from SoundCloud into your post. Use the track URL in your browser: [soundcloud]http://soundcloud.com/forss/speech-craft-no-sleep-til-dawn-remix-by-forss[/soundcloud]

    Cheers, Ace.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Here are instructions to convert your BB codes after the import:

    1) Install this addon:


    2) Use these settings:

    Quick Find: [soundcloud

    Regular expression: #\[soundcloud\]http://soundcloud\.com/([\-a-z0-9_]+/[\-a-z0-9_]+)\[/soundcloud\]#siU

    Replacement String: [media=soundcloud]\1[/media]

    I tested it on my forum and it works.

    Screen shot 2012-04-08 at 5.52.46 AM.png
  5. Acelondoner

    Acelondoner Member

    I get an error when doing the above:

  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Increase this limit:

    Admin CP -> Home -> Options -> Messages -> Maximum Media Embeds per Message
    ArnyVee likes this.
  7. Acelondoner

    Acelondoner Member

    Cheers man, worked great.
  8. ArnyVee

    ArnyVee Well-Known Member

    Jake is the man! :)
    Shelley and Trombones13 like this.
  9. Silvan

    Silvan Member

  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That requires a new media site.

    I looked at the embed code for the set. This one is difficult because the id used in the embed code is not contained in the URL. It requires page scraping to enable automatic embedding based on the URL (page scraping is yucky). Or you can manually type the BB code and manually enter the id which makes for a much simpler media site (to create) but it's less usable as it requires the user to find the id.
  11. Silvan

    Silvan Member

    Sorry, i'm not particularly good with BB code, but how would I manually add the id?
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Admin CP -> Home -> BB Code Media Sites -> Add BB Code Media Site

    Media Site ID: soundcloudset

    Site Title: SoundCloud Set

    Site URL: http://soundcloud.com/

    Match URLs: <leave it empty>

    Embed HTML:

    <iframe width="100%" height="450" scrolling="no" frameborder="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F{$id}&show_artwork=true"></iframe>
    URLs tested:
    http://soundcloud.com/adrielm5/sets/maroon-5-overexposed-preview/ (you need to manually get the id from the source code, which is 2092643 in this example)

    Then you need to manually type in the BB code into your post which is:

    telugutammullu and Trombones13 like this.
  13. Trombones13

    Trombones13 Well-Known Member

    I've been following this thread since I'd like to do the same thing. Your description works, Jake, but I don't see where you got the 2092643 ID from; I don't see it anywhere in the page source.
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    From the page source:

    <div class="set large" data-sc-playlist-id="2092643">
    Or if you click the Share button in the player it will give you embed code which contains the id.
  15. Trombones13

    Trombones13 Well-Known Member

    Oh; I just realized why I couldn't see it in the page source--I'm on their redesigned site. It is in the embed code, though, so I can still get to it. (y)
  16. cdub

    cdub Well-Known Member

    Whenever I try embedding it says "The specified URL cannot be embedded as media."
  17. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    What URL?
  18. Silvan

    Silvan Member

    Best way is to download the add-on for SoundCloud support, or get the Media Pack addition. Works really well.
  19. Dedy

    Dedy Member

    What is a soundcloud for? Is this for hearing MP3 song from the forum?
  20. Silvan

    Silvan Member

    if you want to embed a song in your forum, i.e. if you have a forum that's about music, you might want to embed the song in the post, rather than people having to download the MP3.

Share This Page