RSS

Resize YouTube Video

08 Dec

Here is the code how to resize youtube video embed code, even this code will work to non-youtube embed videos…..

<?php

$embed = ‘‘;

//$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:
http://www.youtube.com/v/jWDmG3JnNLE&hl=en_US&fs=1&

Advertisements
 
1 Comment

Posted by on December 8, 2009 in Uncategorized

 

Tags: , , , , , , ,

One response to “Resize YouTube Video

  1. admin

    February 14, 2011 at 6:36 am

    Hey,
    This code used here to resize embed code from youtube.com

    http://modxcms.com/extras/repository/packages/youtube
    http://modxcms.com/extras/package/?package=698

    Great!

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: