Archive
Subscribe via RSS
Change Colours

Teleute

Tue 14 Jul

Better Vimeo embeds on Tumblr

Reblogged from Matthew Buchanan:

matthewb:

Vimeo offers plenty of customisation options when embedding its player, but Tumblr’s automated code generator doesn’t respect these, overwriting them with its own defaults. To fix this, I wrote a quick jQuery function to rewrite Tumblr’s default options string for all Vimeo embeds on the current page:

$("object[data^='http://vimeo.com']").each(function() {
    var vimeoCode = $(this).parent().html();
    var defaultOpts = /show_title=1&show_byline=0&show_portrait=0&color=00ADEF/g;
    var newOpts = "show_title=0&show_byline=0&show_portrait=0&color=55CC55";
    vimeoCode = vimeoCode.replace(defaultOpts, newOpts);
    $(this).parent().html(vimeoCode);
});

Tweak the newOpts string to whatever you prefer — it will work for all embeds except those that have had their options locked by their respective owners. You can see it in action here.

Yeah, probably should have tested this in IE. Sigh — will fix.

IE, gotta love it.