Php Function to resize video from YouTube and Vimeo


/ Published in: PHP
Save to your folder(s)

I’ve made this function that receive the input $video string that contains the dirty embed code as it is from youtube. The second parameter $new_width (if specified) permits to resize the embed code proportionally to the width you need for your template. This function removes also unwanted tags added after the important tag (such as happens from Vimeo embeds that have a p tag after the iframe).

URL: http://www.barattalo.it/2010/10/06/php-function-embed-video-youtube-vimeo/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.