Youtube / Vimeo embed resizer

Resizes a Youtube / Vimeo embed code from a Template variable with the variables given in the snippet call… 1- Create a new Snippet and call it  videoresizer 2- Copy – paste the content of videoresizer.snippet.txt on your new snippet 3- Enjoy! Example: [[videoresizer? &id='[*id*]’ &width=’300′ &height=’350′ &my_tv=’video’]] videoresizer.snippet.txt <?php //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Snippet Name: … Read more

Resize YouTube Video

Here is the code how to resize youtube video embed code, even this code will work to non-youtube embed videos….. <?php $embed = ‘<object width=”425″ height=”344″><param name=”movie” value=”https://www.youtube.com/v/jWDmG3JnNLE&hl=en_US&fs=1&”></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”https://www.youtube.com/v/jWDmG3JnNLE&hl=en_US&fs=1&” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”425″ height=”344″></embed></object>’; //$alt = preg_match_all(‘/(width|height)=(“[^”]*”)/i’, $embed, $matches); $embed = preg_replace(‘/(width)=(“[^”]*”)/i’, ‘width=”200″‘, $embed); $embed = preg_replace(‘/(height)=(“[^”]*”)/i’, ‘height=”200″‘, $embed); echo $embed; … Read more