Resize YouTube Video


Hits: 2018  

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=”http://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=”http://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;

?>

Output here:

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch

8 thoughts on “Resize YouTube Video”

  1. Pingback: psychology of golf
  2. You actually make it seem so easy with your
    presentation but I find this matter to be really something that I think I would never understand.

    It seems too complex and extremely broad for me. I am looking forward for your next
    post, I’ll try to get the hang of it!

  3. I do not even know how I ended up here, but I thought this post was good.
    I do not know who you are but definitely you are going to
    a famous blogger if you aren’t already 😉 Cheers!

Leave a Reply

Your email address will not be published.

*