This is for Invision Power Board, but it should easily translate over to vBulletin with a few tweaks. This code parses links so people don't need to manually use BB code at all.
YouTube: -
Media replacement match: -
Code:
http://(www.)?youtube.com/watch\?v=([\d\w-_]+?)(&\S+?)?
Code: -
Code:
<object style="height: 390px; width: 640px"><param name="movie" value="http://youtube.com/v/$2?version=3" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://youtube.com/v/$2?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed></object>
YouTu.be (for when people use the "Share" links): -
Media replacement match: -
Code:
http://(www.)?youtu.be/([\d\w-_]+?)$
Code: -
Code:
<object width="640" height="390"><param name="movie" value="http://youtube.com/v/$2"></param><param name="wmode" value="transparent"></param><param name="flashvars" value="fs=1&autoplay=0&playerMode=embedded"></param><embed src="http://youtube.com/v/$2" type="application/x-shockwave-flash" wmode="transparent" width="640" height="390"></embed></object>
Mixcloud: -
Media replacement match: -
Code:
http://www.mixcloud.com/{1}/{2}/
Code: -
Code:
<div> <object width="300" height="300">
<param name="movie" value="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf"></param>
<param name="allowFullScreen" value="true"></param> <param name="allowscriptaccess" value="always"></param>
<param name="flashVars" value="feed=http://www.mixcloud.com/$1/$2/?for_player=1"></param>
<embed src="http://www.mixcloud.com/media/swf/player/mixcloudLoader.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="feed=http://www.mixcloud.com/$1/$2/?for_player=1" width="300" height="300"></embed></object>
<div style="clear:both; height:3px;"></div> <p style="display:block; font-size:12px; font-family:Helvetica, Arial, sans-serif; margin:0; padding: 3px 4px 3px 4px; color:#999;">
<a href="http://www.mixcloud.com/$1/$2/?utm_source=widget&utm_medium=web&utm_campaign=base_links&utm_term=cloudcast_link" style="color:#02a0c7; font-weight:bold;">Click here</a> to see it on Mixcloud</p>
<div style="clear:both; height:3px;"></div> </div>
SoundCloud: -
Media replacement match: -
Code:
http://soundcloud.com/{1}/{2}
Code: -
Code:
<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F$1%2F$2"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2F$1%2F$2" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/$1/$2">Listen on SoundCloud.com</a></span>
Bookmarks