|
Post by ben on Jul 21, 2010 14:19:54 GMT
Soundcloud and Youtube are both operational here. Embedding is simple For Youtube, go to full reply (not quick obviously) and push the button and plug the url in between the tags. Or type out the word youtube in the tags, make sure to close the second tag with / For Soundcloud... (sc) (/sc) not parentheses obviously. What you want is the bit in the URL after soundcloud.com/gyber/led-zeppelin-dazed-and-confused-remix"Gyber" so only the last bit (led-zepp blah blah blah)would be needed to post this particular track.
|
|
|
Post by rbbrslmn on Jul 21, 2010 14:21:54 GMT
edit. never mind
ben can you make it so youtube just plays if you put any link on here?
|
|
|
Post by tucker on Jul 21, 2010 14:24:30 GMT
yeah I've been looking for that code ben, can't find it anywhere - you had it for all the video sites on the last soapbox
|
|
|
Post by ben on Jul 21, 2010 14:38:31 GMT
Copy paste all of this....
HEADER
<script type='text/javascript'>
<!-- /* Any Video in Post (header portion)- Eton Bones*/ /* last updated: 7/27/2008 (rev 9) */ var caller=[]; var vidType={ _Globals:{ defaultType:'Embed', params:{allowfullscreen:true, allowscriptaccess:'always', pluginspage:'http://www.macromedia.com/go/getflashplayer', type:'application/x-shockwave-flash', classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', quality:'autohigh', codebase:'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab', wmode:'transparent'}, maxVidsPerPost:1, maxVidsPerPage:3, defaultWidth:'600px', defaultHeight:'450px', canPost:'-Guest', //canView:'-Guest', autoLink:'YouTube' }, Embed:{ prefix:'%video%', checkid:function(vid){ if(/<(object|embed)\b/im.test(deEntify(vid)) /*&& /\.swf\b/i.test(vid)*/)return true; else return false;}, postprocess: function(ret){ var w=vidType['Embed'].maxwidth; var h=vidType['Embed'].maxheight ret=deEntify(caller[caller.length-1].arguments[2]) if(!/width=\d+/i.test(caller[caller.length-1].arguments[0].split(/\]/)[0]))w=0 if(!/height=\d+/i.test(caller[caller.length-1].arguments[0].split(/\]/)[0]))h=0 ret=ret.replace(/(width|height)=['"]?(\d+)/gi,function(m,p1,p2){ if(/width/i.test(p1)&&w>0){ m=m.replace(/width=('|")\d+/i,'width=$1'+w) }else if(/height/i.test(p1)&&h>0){ m=m.replace(/height=('|")\d+/i,'height=$1'+h) } return m; }) //disable all SWF browser navigation and browser interaction APIs to avoid possible popups if(/\ballownetworking\b/i.test(ret)) ret=ret.replace(/(value|allownetworking)=('|")all['"]/gim, "$1=$2internal$2"); else ret=ret.replace(/<embed\s/gi,'<embed allownetworking="internal" ').replace( /<param\s/i,'<param name="allownetworking" value="internal"/><param '); return String('<div name="swfPlayer">'+ret) }, preprocess:function(vType,vURI){ //attempt to fix Proboards' hard wraps vURI=pb_unwrap(vURI) //allow only specific HTML tags vURI = vURI.replace(/&(nbsp);?/gi,' ').replace(/&(quot);?/gi,'"').replace(/(<|&l{1}t;?)\s*(\/?\w+)/gi,function(m,p1,p2,i,s){ p1=''; if(p2.substr(0,1)=='/'){p1='/';p2 = p2.substr(1)} p2=p2.toLowerCase() if(p2== 'embed'){ var t = s.substr(i).split(/>/)[0]; if(t.match(/type\s*=\s*['"]?([^'"\s]+)/)) {if(!/shockwave-flash/i.test(RegExp.$1))return ''+'60;' + p1 + p2} }else if( p2.match(/^(param|object)$/)){ return '<font></font' }else if( p2.match(/^(table|tr|td|thead|tbody|tfoot|th|center)$/)){ }else if( p2.match(/^(font|a|span|div|img|br|b|i|u|s|hr)$/)){ }else{ return ''+'60;' + p1 + p2 } return m }); //disable possible script handlers vURI=vURI.replace(/\bon(\w+)=/gi,'no$1=').replace(/javascript\:/gi,'pbscript[IMG]http://img.photobucket.com/albums/v683/GoldenSupanova/icon_happycry.gif[/IMG] caller[caller.length-1].arguments[2]= vURI }, description:'Embed Code' }, AnySWF:{ prefix:'%video%', description:'Generic SWF Player', maxwidth:'425px', maxheight:'350px', params:{flashvars:_getFlashVars}, checkid:function(vid){return /\.swf(\?|\s*$)/i.test(vid)} }, AnyFLV:{ prefix:'http://www.jeroenwijering.com/embed/mediaplayer.swf?file=%video%', description:'Generic FLV Player', maxwidth:'720px', maxheight:'350px', custom:{skinall:'&displayheight=%height%&displaywidth=%width%',skin1:'&lightcolor=0x000000&backcolor=0x334455&frontcolor=0x666666&screencolor=0xFFFFFF'}, params:{flashvars:_getFlashVars}, preprocess:function(vType,vURI){this['flashvars']=((this['flashvars'])?this['flashvars']:'');this.flashvars=this.flashvars.replace(/%height%/gi,parseInt(this.maxheight)).replace(/%width%/gi,parseInt(this.maxheight));if(vURI.match(/\.(flv|mp4|m4v|m4a|3gp|mov|f4v|f4p|f4a|f4b)(\?|\s*$)/i))this.flashvars+='&type='+RegExp.$1;}, checkid:function(vid){return /\.(flv|mp4|m4v|m4a|3gp|mov|f4v|f4p|f4a|f4b|xml|asx)(\?|\s*$)/i.test(vid)} }, WMP:{ prefix:'%video%', description:'Windows Media Player', example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=18', params:{CLASSID:'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6', invokeurls:0, autostart:0,playcount:1, name:'mediaplayer1',CODEBASE:'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',pluginspage:'http://www.microsoft.com/Windows/MediaPlayer/',type:'application/x-mplayer2'} }, Quicktime:{ prefix:'%video%', example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=17', params:{CLASSID:'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', autoplay:0 , name:'quicktimeplayer1', CODEBASE:'http://www.apple.com/qtactivex/qtplugin.cab',pluginspage:'http://www.apple.com/quicktime/download',type:'video/quicktime'} }, Real:{ description:'Real Player', prefix:'%video%', example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=15', preprocess:function(vType,vURI){if(!vURI.match(/\?embed$/i))caller[caller.length-1].arguments[2]+='?embed'}, postprocess:function(ret){ //real player requires separate controls for vid and control panel ret+='<br><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" '+ret.match(/width=[^\s]+/)[0]+' '+ ' height="36" >' ret+='<param name="controls" value="ControlPanel">'; ret+='<param name="console" value="vidplayer">'; ret+=ret.match(/\<embed[\w\W]+?<\/embed>/im)[0].replace(/controls="ImageWindow"/,'controls="ControlPanel"').replace(/height=".+?"/,'height="36"') ret + '></object>' return ret }, params:{CLASSID:'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', autogotourl :0 , autostart :0, controls:'ImageWindow', console:'vidplayer', pluginspage:'http://www.real.com/', /*type:'audio/x-pn-realaudio-plugin'*/type:'application/vnd.rn-realplayer'} }, VLC:{ prefix:'%video%', description:'VideoLAN (VLC)', params:{CLASSID:'clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8',CODEBASE:'http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab',pluginspage:'http://www.videolan.org',type:'application/x-vlc-plugin'} } }
function aV(video){ video=(video)?video:vidType._Globals.defaultType add("[video=", "[/video]", video); } function _getFlashVars(){ var vType=caller[caller.length-1].arguments[1]; var a=prefix.split(/\?/); prefix=a[0]; if(a.length==1)a.push('') if(vidType[vType]['flashvars']){ a[1]+=((a[1].length)?'&':'')+vidType[vType]['flashvars']; } return a[1] } function deEntify(sStr){ return sStr.replace(/&am{1}p;/gi,"&").replace(/&l{1}t;/gi,"<").replace(/&g{1}t;/gi,">") } function pb_unwrap(sStr){return sStr.replace(/([^\s\n\r]{111,})(\s|%20)/gm,'$1')} function trim(sStr){ return sStr.replace(/(^\s+|\s+$)/g,'') }
function isAllowed(users,user){ if(!vidType._Globals[users])return true var u=vidType._Globals[users] u=u.split(/,/).sort().reverse().join('|') var v=u.indexOf('-') if(v>-1){ if(RegExp('^('+u.substr(v).replace('-','')+')$').test(user))return false; u=u.substr(0,v).replace(/|$/,'') } if(u.length){ if(RegExp('^('+u+')$',"i").test(user))return true; return false; }else{ return true;} }
function disableVideo(vid,link,title){ title=(title)?title:'' var ret='<a href="javascript:void(0)" onClick="enableVideo(this)" title="'+title+'">' ret+=link+'</a><xm'+'p style="display:none;">'+ vid +'</xm'+'p>' return ret } function enableVideo(thiss){ var v=document.createElement('div'); v.innerHTML=deEntify(thiss.nextSibling.innerHTML); thiss.parentNode.replaceChild(v.firstChild,thiss.nextSibling); thiss.style.display="none" } function makeEmbed(m,vType,vURI){ var params=''; var attribs=null; if(mTD[i].getElementsByTagName('a').length<((window['pb_VersionNo'])?2:1) && !isAllowed('canPost','Guest')) return '<DIV>Guests are not allowed to post videos</DIV>' if(mTD[i].getElementsByTagName('a').length>((window['pb_VersionNo'])?2:1) && mTD[i].getElementsByTagName('a')[((window['pb_VersionNo'])?2:1)].href.match(/user=(\w+)/) && !isAllowed('canPost',RegExp.$1)) return '<DIV>'+mTD[i].getElementsByTagName('a')[((window['pb_VersionNo'])?2:1)].innerHTML + ' is not allowed to post videos</DIV>' if(vidType._Globals['boards'] && !vidType._Globals['boards'].match(/\bmain\b/i))vidType._Globals['boards']+=",main"; if(!isAllowed('boards',((document.getElementsByName('board').length)?document.getElementsByName('board')[0].value:'main'))) return m; if(!vType)vType=vidType._Globals.defaultType; if(!/^Embed\b/.test(vType) && vURI.match(/href=['"]?([^\s'">]+)/i))vURI=RegExp.$1; //if(/\<\s*(embed|object)/i.test(m))return m if(/,/.test(vType)){attribs=trim(deEntify(vType.substr(vType.indexOf(',')+1)));vType=trim(vType.split(/,/)[0]);} if(!vidType[vType]) return m; if('checkid' in vidType[vType]) if(!vidType[vType].checkid(vURI)) return m; caller.push(arguments.callee) //opera+safari don't support arguments.callee.caller if(!vidType[vType]['maxwidth'])vidType[vType].maxwidth=vidType._Globals.defaultWidth; if(!vidType[vType]['maxheight'])vidType[vType].maxheight=vidType._Globals.defaultHeight; prefix=vidType[vType].prefix if(attribs){ vidType[vType].maxwidth=(/width=([^,]+)/i.test(attribs) && parseInt(RegExp.$1)<=parseInt(vidType[vType].maxwidth))?RegExp.$1:vidType[vType].maxwidth; vidType[vType].maxheight=(/height=([^,]+)/i.test(attribs) && parseInt(RegExp.$1)<=parseInt(vidType[vType].maxheight))?RegExp.$1:vidType[vType].maxheight; if(attribs.match(/flashvars=([^,]+)/i)){if(/\?/.test(prefix))prefix+='&'; else prefix+='?'; prefix+=trim(attribs.match(/flashvars=([^,]+)/i)[1])} } if("custom" in vidType[vType]){ if(!('flashvars' in vidType[vType]))vidType[vType].flashvars=''; if('skin'+pb_skinid in vidType[vType].custom)vidType[vType].flashvars+=((vidType[vType].flashvars.length && vidType[vType].custom['skin'+pb_skinid].substr(0,1)!='&')?'&' + vidType[vType].custom['skin'+pb_skinid]:vidType[vType].custom['skin'+pb_skinid]) if('skinall' in vidType[vType].custom)vidType[vType].flashvars+=((vidType[vType].flashvars.length && vidType[vType].custom['skinall'].substr(0,1)!='&')?'&'+ vidType[vType].custom['skinall']:vidType[vType].custom['skinall']) } if("preprocess" in vidType[vType])vidType[vType].preprocess(vType,vURI) prefix=prefix.replace(/%video%/g,vURI) var ret='<div name="swfPlayer"><OBJECT width="'+ vidType[vType].maxwidth + '" height="'+ vidType[vType].maxheight + '" data="'+prefix.replace(/%video%/,vURI).split('?')[0]+'" standby="Loading player components..." >' ret+= '<PARAM name="movie" value="'+prefix + '" />'; ret+= '<PARAM name="url" value="'+prefix + '" />'; ret+= '<PARAM name="src" value="'+prefix + '" />'; if("params" in vidType[vType]){ for(var v in vidType[vType].params){ var ret1=("function"==typeof vidType[vType].params[v])?vidType[vType].params[v]():vidType[vType].params[v] if(!/^pluginspage$/.test(v)){ if(!/^(classid|codebase)$/i.test(v)) ret+= '<PARAM name="'+v + '" value="'+ ret1 + '" />'; else ret=ret.replace(/<OBJECT\s/i,'<OBJECT '+v+'="'+ret1+'" ') } if(!/^(classid|codebase)$/i.test(v)){ params+= v + '="'+ ret1 + '" '; } } } for(var u in vidType._Globals.params){ if(!ret.match(new RegExp('name="'+ u +'"','i')) && !ret.match(new RegExp( u +'="','i')) && !params.match(new RegExp( u +'="','i'))){ var ret2=("function"==typeof vidType._Globals.params[u])?vidType._Globals.params[u]():vidType._Globals.params[u] if(!/^pluginspage$/.test(u)){ if(!/^(classid|codebase)$/i.test(u)) ret+= '<PARAM name="'+ u + '" value="'+ ret2 + '" />'; else ret=ret.replace(/<object\s/i,'<OBJECT '+u+'="'+ret2+'" ') } if(!/^(classid|codebase)$/i.test(u)) params+= u + '="'+ ret2 + '" '; } } ret= '<div name="swfPlayer">' //7/4/08 abandon twice cooked embedding for <embed> alone ret+= '<embed src=\042'+ prefix.replace(/%video%/,vURI) ret+= '\042 width="'+ vidType[vType].maxwidth + '" height="'+ vidType[vType].maxheight + '" '+ params ret+= ' id="_'+perPage+'"></embed>' //</object>' if('postprocess' in vidType[vType])ret=vidType[vType].postprocess(ret) ret+='</div>' perPost++; if(!isLink && (vidType._Globals.maxVidsPerPost<perPost || vidType._Globals.maxVidsPerPage<perPage || (attribs && attribs.match(/disabled?=(true|[1-9])/i)))) ret=disableVideo(ret,'<div style="text-align:center;line-height:30px;width:'+vidType[vType].maxwidth+';height:'+vidType[vType].maxheight+';" class="bordercolor" ><br><br>This video has been disabled to save bandwidth.<br> Click to enable</div>') else perPage++; caller.pop(); return ret } //-->
</script>
<script> /* AVIP Addon:Vimeo (global header below AVIP header code) - Eton Bones*/ if(window['vidType']){ vidType['Vimeo']={}; vidType['Vimeo'].prefix='http://www.vimeo.com/moogaloop.swf?clip_id=%video%&server=www.vimeo.com&show_title=1&show_byline=1&show _portrait=0'; } </script>
<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>
<script> /* AVIP Addon:DailyMotion (global header below AVIP header code) - Eton Bones*/ if(window['vidType']){ vidType['DailyMotion']={}; vidType['DailyMotion'].prefix='http://www.dailymotion.com/swf/%video%'; vidType['DailyMotion'].params={flashvars:_getFlashVars}; vidType['DailyMotion'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=23'; vidType['DailyMotion'].preprocess=function(vType,vURI){if(vURI.match(/video\/([^_]+)/))caller[caller.length-1].arguments[2]=RegExp.$1}; vidType['DailyMotion'].custom={skin1:'colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300'}; } </script>
<script> /* AVIP Addon:Game Trailers (global header below AVIP header code) - Eton Bones*/ if(window['vidType']){ vidType['GT']={}; vidType['GT'].prefix='http://www.gametrailers.com/remote_wrap.php?mid=%video%'; vidType['GT'].description='Game Trailers'; vidType['GT'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=31'; vidType['GT'].preprocess=function(vType,vURI){if(vURI.match(/([^/]+)\.html?/))caller[caller.length-1].arguments[2]=RegExp.$1}; } </script>
<script> /* AVIP Addon:iMeem (global header below AVIP header code) - Eton Bones*/ if(window['vidType']){ vidType['iMeem']={}; vidType['iMeem'].prefix='http://media.imeem.com/v/%video%/aus=false/pv=2' } </script>
FOOTER
<script type='text/javascript'>
<!-- /*Any Video in Post (footer portion)- Eton Bones */ /* last updated: 8/10/2008 (rev9)*/ var _color=document.getElementsByName('color') if(document.postForm && _color.length && isAllowed('canPost',pb_username) && isAllowed('boards',((document.getElementsByName('board').length)?document.getElementsByName('board')[0].value:'main'))){ _color=_color[0]; var select=document.createElement('select'); select.options[0]=new Option('videos','') for(var v in vidType){ if(v.substr(0,1)!="_") select.options[select.options.length]=new Option(('description' in vidType[v])?vidType[v].description:v,v) } select.options[0].selected=true; select.onchange=function(){ if("example" in vidType[this.options[this.selectedIndex].value]){ document.getElementById('videoExample').innerHTML='For an example of how to insert a'+((/[aeiou]/i.test(this.options[this.selectedIndex].text.substr(0,1)))?'n ':' ')+ this.options[this.selectedIndex].text + ' video into a post please see <a href="' + vidType[this.options[this.selectedIndex].value].example + '" target="_blank">this</a> link.' }else{ document.getElementById('videoExample').innerHTML=''; } aV(this.options[this.selectedIndex].value);this.selectedIndex=0; } _color.parentNode.appendChild(document.createTextNode(' ')); _color.parentNode.appendChild(select) var ex = document.createElement('fieldset'); ex.id = "videoHelp"; ex.innerHTML = '<legend>Video Help</legend><div id="videoExample"></div>' ex.innerHTML += '<a href="http://etonbones.proboards100.com/index.cgi?action=display&board=examples&thread=72" target="_blank">Advanced Postings</a>' document.postForm.message.parentNode.appendChild(ex) }
if((location.href.match(/action=(display|goto|(?:user)?recent|search2|pmview)/i)||(location.href.split(/\//).pop()=="index.cgi" && (document.body.innerHTML.match(/b>\d+\sresults found<\/b/i)||document.title.match(/-\sPreview/)))) && isAllowed('canView',pb_username)){ var mTD=document.getElementsByTagName('td'),imgDisabled=true, perPost=perPage=0,prefix='',isLink=false; for(var i=0;i<mTD.length;i++){ if(imgDisabled && mTD[i].className=="titlebg" && mTD[i].colSpan=="2" && mTD[i].getElementsByTagName('img').length)imgDisabled=false; if(mTD[i].width=="20%" && mTD[i].className.match(/windowbg2?/) && !imgDisabled){ var post=mTD[i].nextSibling; perPost=0; post.innerHTML= post.innerHTML.replace(/\[video=?([^\]]+?)?\]([\s\S]+?)\[\/video\]/gim,makeEmbed); if(vidType._Globals['autoLink'] && vidType._Globals['autoLink'].length){ var v=vidType._Globals['autoLink'].split(/,/) isLink=true; for(var u=0;u<v.length;u++){ try{ret=vidType[v[u]].autolink(post)}catch(e){} } isLink=false; } } } } //-->
</script>
|
|