Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Created June 20, 2011 18:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save OscarGodson/1036156 to your computer and use it in GitHub Desktop.
Save OscarGodson/1036156 to your computer and use it in GitHub Desktop.
Tumblr + Vimeo Mod To Make Videos Larger Than 500
/**
* Makes Vimeo videos on Tumblr larger than the max of 500px that Tumblr forces
* Change the 650 to whatever you want, but do NOT add px or %
* The height, by default, is set to auto which will calculate the 16:9 video size.
* You can set the height to a static number as well if you want.
* If you have any questions feel free to ask me: @oscargodson | oscargodson.com
*/
(function(){
var iframes = document.body.getElementsByTagName('iframe')
, newVimeoWidth = 650
, newVimeoHeight = 'auto';
for(x in iframes){
if(iframes[x].src && iframes[x].src.indexOf('player.vimeo.com') > -1){
if(newVimeoHeight == 'auto'){
newVimeoHeight = ( newVimeoWidth * 9 ) / 16;
}
iframes[x].width = newVimeoWidth;
iframes[x].height = newVimeoHeight
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment