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:
4 Responses to Resize YouTube Video
Leave a Reply
You must be logged in to post a comment.
Certainly completely along with your conclusions and believe you’ve made some excellent points. Also, I prefer the layout of this site along with the easier navigation. I’ve bookmarked your website and will return often!
To be sure with all your thoughts here and I really love your website! I’ve bookmarked it in order that I will revisit & read more down the road.
Hello, Today inside a new directory of blogs. I don’t recognize how your site came up, have to have been a typo. Your website looks good, have a very nice day.
Thanks for the blog article.Really looking forward to read more. Really Great.