Gearbest Banner

Soundcloud BBCodes

Started by Chen Zhen, May 24, 2015, 09:41:18 PM

previous topic - next topic

Chen Zhen

May 24, 2015, 09:41:18 PM Last Edit: May 25, 2015, 06:53:55 PM by Napalm
Here are 2 possible SoundCloud BBCodes that can be used.





#1 ~ Using Stratus Code

This allows the player to appear at the top or bottom of the page.
The last one to appear in that position will override any previous one on the page.
This code includes a migrate file in case the jQuery script on the page out dates the one that is necessary.

User must provide the latter part of the url from the Soundcloud website.

Name: soundcloud
BBCode type: [tag=option]content[/tag]
Parsing: {content} & {option}
Block Level: Enabled

Code Select
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script><script type="text/javascript" src="http://stratus.sc/stratus.js"></script><script type="text/javascript">$(document).ready(function(){ $.stratus({ download: false, align: '{option}', user:false, color:'E8C58B', links:'https://soundcloud.com/{content}'});});</script>


Example usage:
[soundcloud=top]rose-ferre/u2-with-or-without-you[/soundcloud]





#2 ~ Using standard iframe ~ file id

User must provide only the file id from the Soundcloud website.

Name: soundcloud2
BBCode type: [tag]content[/tag]
Parsing: none
Block Level: Disabled

Code Select
<iframe width="100%" height="166" scrolling="no" src="http://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks%{content}&auto_play=false&show_artwork=true" frameborder="0" ></iframe>

example:
[soundcloud2]2F80211077[/soundcloud2]





#3 ~ Using standard iframe ~ full url

User must provide the full url from the Soundcloud website.

Name: soundcloud3
BBCode type: [tag]content[/tag]
Parsing: none
Block Level: Disabled

Code Select
<iframe width="100%" height="166" scrolling="no" src="http://w.soundcloud.com/player/?url={content}&auto_play=false&show_artwork=true" frameborder="0" ></iframe>

example:
[soundcloud3]https://soundcloud.com/man-in-a-loft-downtown/sets/the-latest[/soundcloud3]





Note: The first code (#1) requires the jQuery library therefore v1.9 or a further version is necessary for the SMF 2.0.X branch.