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.

Another excellent looking Tumblr enhancement by Matthew B.

  1. cheap-papers reblogged this from chrisbowler
  2. 0049 reblogged this from matthewb
  3. number13 reblogged this from matthewb
  4. teleute reblogged this from matthewb and added:
    IE, gotta love it.
  5. chrisbowler reblogged this from matthewb and added:
    Another excellent looking Tumblr enhancement
  6. matthewb posted this

All opinions expressed here are those of the author, Chris Bowler. Cupertino Kool-Aid may have had some affect. More laughs and giggles to be found here.

If you like what you've read, some of the my favorite posts are compiled here.