We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Want an easy way to resize embedded video? Look no further

Development and Programming

Electric Putty's avatar
Electric Putty
88 posts
15 years ago
Electric Putty's avatar Electric Putty

Hello,

Loads of our clients want to embed YouTube and Vimeo clips on their websites. We design them a nice template where the player fits perfectly and then they go and upload some wapping great clip and the page falls apart. Sound familiar?

Enter Electric Putty’s Media Object plugin; a simple tool which gives you complete control over the height and width of embedded media.

Media Object uses the Simple HTML DOM parser (http://sourceforge.net/projects/simplehtmldom/) to find the object and embed elements in the submitted code and rewrite their values.

For example:

{exp:media_object width="550"}YOUR MEDIA EMBED CODE HERE{/exp:media_object}

This will resize the media object to a width of 500px and scale the height so the proportions are maintained. You can do it the other way round and specify a height value and Media Object will update the width automatically.

If you want complete control you can specify both height and width, but this could effect the aspect ratio making people look either very tall or very fat, so do this with caution.

Media Object has been tested with YouTube, Vimeo and SoundCloud media objects.

I hope this is of some use to others.

Thanks,

Malcolm

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.