Post by Eton Bones on Feb 9, 2008 14:16:41 GMT -5
[bg=red] This youtube addon is now against Proboards TOS Jul 2, 2008 18:09:35 GMT -5 @Patrick@support.proboards.com said: Using any other YouTube-enabling code to enable videos on your forum (which avoids the ads) is a violation of our Terms of Service for hiding ads. Patrick |
[bg=mistyrose] |
Video Type:YouTube
UBBC:[video=YouTube]-iVAPH_EcmQ#[/video]
How to insert video: The part in red is the video identifier:
http://www.youtube.com/watch?v=-iVAPH_EcmQ
note:YouTube's player is the most versatile of the bunch in terms of customizing color to match website/blog/forum. It takes any two hex color you specify and automatically creates a gradient on the border.
The code takes advantage of this by allowing the admin to specify separate color schemes for different forum skins
Addon Code:
<script>
/* AVIP Addon:YouTube (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['YouTube']={};
vidType['YouTube'].prefix='http://www.youtube.com/v/%video%';
vidType['YouTube'].params={flashvars:_getFlashVars};
vidType['YouTube'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=20';
vidType['YouTube'].custom={skinall:'border=1',skin1:'color1=0x234900&color2=0x4e9e00',skin2:'color1=0x000000&color2=0xFFFFFF'}
// remove user specified color scheme if admin color scheme is present
vidType['YouTube'].preprocess=function(vType,vURI){if(vidType[vType].custom && ('skin'+pb_skinid in vidType[vType].custom))caller[caller.length-1].arguments[2] = caller[caller.length-1].arguments[2].replace(/&(amp;)?(border|color[12])=[^&]+/gi,'');
if(vURI.match(/\bp=([^&]+)/)){caller[caller.length-1].arguments[2]=RegExp.$1;prefix=prefix.replace(/\/v\//i,'/p/')}else if(vURI.match(/[?&]v=([^&]+)/)){caller[caller.length-1].arguments[2]=RegExp.$1}}
vidType['YouTube'].autolink=function(post){
post.innerHTML=post.innerHTML.replace( /<a\b[^>]+?href=['"]?(http:\/\/(?:\w+\.)*?youtube.com\/watch.+?\bv=([^?&'"\s]+))[^>]*?>([^<]+?)<\/a>/gim, function(m,p1,p2,p3){
return disableVideo(makeEmbed('[video='+'YouTube]'+p2+'[/video]','YouTube',p2),p3,'Click to watch this video inside this post')
})
}
}
</script>
*The auto-link-conversion feature of this addon requires an AViP header and footer with a last update date of 4/15/08 or later or revision 8 or higher (which can be identified by the encapsulation of the embedding core into the newly created makeEmbed function)
Update: Added support for YouTube playlists (6/3/2008). Recopy the youtube addon code to use this new feature [example]
[Agent:2]