$('a[href*="youtube.com/"]').each(function(){
if(m=this.href.match(/v=([^&]+)/)){
$(this).after('<a href="/yt.cfm?yt='+m[1]+'" title="Play Video" class="vid" target="_self">
<img src="http://d217i264rvtnq0.cloudfront.net/images/mefi/youtube_yellow.png"
border="0" width="11" height="12" alt="yt"></a>')
}
});
I know the actual code is a little more complex, but not much, and the processing time on your end would go down to zero. It seems to make particular sense to do it this way given that the inline player is a nice bonus rather than a core feature, and only useful to people with javascript anyway. Are there reasons it ends up making sense to do the processing on the server? Or is it just not a big enough deal to mess with?
posted by rebent at 6:46 AM on August 31, 2012