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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.