YouTube logo

By default, embedded YouTube videos are 425 pixels wide, which is wider than the content column on Choking on Popcorn. To be able to easily resize and add cool videos to that site I copy-pasted together a very basic plugin for WordPress. It allows you to simply use something like [youtube ]xxxxxxxxx[/youtube] to embed the video. The ‘xxxxxxxxx’ bit needs to be replaced with the actual video’s ID of course. I know there are tons of plugins that do similar things and are vastly superior, but this one suits my needs perfectly.

The output is valid XHTML, and you can adjust the display size by editing the plugin a bit. The entire thing is only a few lines so you’ll have no trouble finding the dimensions in the code. Simply replace the numbers 425 (width) and 350 (height) with numbers that fit your site’s layout. Simply use the options panel under Options -> Youtuber.

Feel free to download it and play around with it a bit. If you make improvements or can think of a cooler name for the plugin, please let me know.

Download the Youtuber plugin for WordPress (current version: 1.2).

Installation

  • Download the zip file and unpack the file inside.
  • Upload this file to the wp-content/plugins folder on your server.
  • Activate it on WordPress’s ‘plugins’ tab.

To embed a video using the plugin, follow these steps:

  • Find the video on YouTube.
  • Extract the ID fromthe video page url. These look something like: http://youtube.com/watch?v=Krhl2o_uwdc. The bit I put in bold type is the ID.
  • Type [youtube ]Krhl2o_uwdc[/youtube] anywhere in your post. Leave out the space in the first tag.
  • Save and publish the post.

To change the display resolution for the videos:

  • Open youtuber.php in a text editor (I use Notepad++)
  • Find the numbers 425 and 350.
  • Replace these numbers with your preferred display dimensions. The control bar underneath the video is about 20 pixels high, so the height should ideally be 3/4 of the width plus 20 pixels.
  • Save the file and (re)upload to your plugins folder.
  • Go to Options -> Youtuber and type in the values that work for your blog.

History

  • Version 1.2 adds better default values, case insensitive tags, and fixes an issue with WPMU.
  • Version 1.1 adds a basic options panel.
  • Version 1.0 was the initial release.
Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • StumbleUpon

Filed under: English, WordPress plugins | Tags: , , , , | Roy | August 27, 2007

32 Comments

  1. [...] YouTuber lets you add videos from YouTube and adjust the size of the videos to fit your blog. (No Ratings Yet)  Loading … Sphere: Related Content [...]

    Pingback by Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 8/28 — August 28, 2007 @ 5:38 am

  2. yes i have idea for the name “tube sizer” :)
    if u like it and decide to use it , pls refer me :)
    http://www.sunipeyk.com

    Comment by sunipeyk — August 28, 2007 @ 7:39 am

  3. I like the name YouTuber, so I’d stick with that :-) Cool plugin!

    Comment by suzero — August 28, 2007 @ 8:58 am

  4. Neues WP-Plugin: Youtuber…

    yigg_url=’http://dns.hayami-kishimoto.net/~fadenb/blog/wordpress/index.php/1970/01/01/’;Mit dem Plugin soll es möglich sein Youtube-Videos direkt als gültiges XHTML in die Beiträge einzufügen.
    Jetzt stellt sich nur die Frage welches der vielen Vi…

    Trackback by Poldis Blog - meine Welt — August 28, 2007 @ 10:05 am

  5. [...] Links Pro Wp Link Mentor Multiple Social Bookmarking Plugins Viewer Slimbox Visitor Counter Widget Youtuber Authimage IMDB Movie Information Tag Move Comments Slickr Gallery Trustmeter for Google Addpile [...]

    Pingback by matthew trevino’s scarform.com » Blog Archive » Recap for August 23rd to the 28th (Wordpress) — August 28, 2007 @ 10:39 am

  6. [...] ja, eindelijk is het gelukt een YouTube filmpje op mijn weblog te plaatsen. Ik heb daarvoor de Youtuber plugin [...]

    Pingback by pavl op ‘t web 2.0 » video — August 28, 2007 @ 7:57 pm

  7. Thanks for the plugin. I tried some other plugins, but they didn’t work. Yours is very simple and it does work!

    Comment by Paul — August 28, 2007 @ 8:07 pm

  8. Thanks Paul, that was what I was aiming for :)

    Comment by Roy — August 28, 2007 @ 8:46 pm

  9. This plugin was exactly what I was looking for. It was easy to get it up and running. Keep up the good work.

    Comment by me — August 29, 2007 @ 5:12 am

  10. Worked great on my page. Resizing was absolutely necessary and this worked without any fuss. Thanks a lot for the nice work.

    Comment by Christopher — August 29, 2007 @ 9:16 pm

  11. [...] Roy Tanck’s weblog » WordPress plugin: Youtuber [...]

    Pingback by Youtuber | わーどぷれすっ! — September 7, 2007 @ 3:20 pm

  12. [...] Visit [...]

    Pingback by WordPress Plugins Database » Plugin Details » Youtuber — September 8, 2007 @ 1:33 pm

  13. After trying all the other You Tube plugins I decided to opt for your one as I could not get the others to work quickly enough. i am quite impatient and want things done for yesterday and your plugin did the trick.

    You can see the results at http://www.tipsfordogs.com Many thanks for the plugin!
    Haydn

    Comment by Haydn Tomas — September 17, 2007 @ 9:07 am

  14. [...] működik. Ez az e. Zsoltitól majd megkérdezem hétfőn, hogy hogyan kell a wp-editorba custom gombot tenni, és majd [...]

    Pingback by le junk — September 29, 2007 @ 12:56 am

  15. hi, i’ve uploaded and activated the plugin into my wordpress 2.3. however when i type the code, e.g.: [youtube ]ID[/youtube] into my post, the youtube video didn’t display. kindly help…thank you very much….:)

    Comment by CE — October 12, 2007 @ 4:46 am

  16. i’ve manage to get this plugin works! thanks! sorry forgot to leave out the space in the code. hehe…. :P

    Comment by CE — October 12, 2007 @ 5:07 am

  17. [...] YouTuber lets you add videos from YouTube and adjust the size of the videos to fit your blog [...]

    Pingback by The Blog for DesignCreatology » Blog Archive » WP Plugs October 19, 2007 — October 20, 2007 @ 12:32 am

  18. Thank you! Thank you! I could not get a YouTube video to post on my site correctly until I tried your plugin. Works great and very easy! Love the name of it, too. Thanks!

    Comment by TLS — October 26, 2007 @ 7:39 pm

  19. Nice plugin! This is what i am looking for. Thank you. ^_^

    Comment by Direct Download Center — November 1, 2007 @ 4:31 pm

  20. [...] Youtuber pluginThis one helps you to add a Youtube vide and resize the vide to fit your design too. [...]

    Pingback by Wordpress plugins and themes for the week - Web 2.0 style — November 19, 2007 @ 5:58 pm

  21. Cool plugins that i’ve waiting for, thanks….

    Comment by juragan — December 9, 2007 @ 11:13 am

  22. it’s good to have this plugins for enbed my videos…

    Comment by Am — December 24, 2007 @ 8:14 pm

  23. Dude, thanks for making this so simple. Much appreciated, and great work. :-)

    Comment by Gav Reilly — January 13, 2008 @ 12:11 am

  24. Thanks for the plug in…I was having trouble embedding the vids. Looks great now, thanks for the work!

    Comment by joe | download 10000 BC full movie — March 2, 2008 @ 9:41 pm

  25. I found this site where they explain you how to get direct links to your website directly from you tube. Its cool. thanks

    Comment by Javier — March 8, 2008 @ 12:59 am

  26. hello,

    i personally use the plugin on my site,it’s simple and works great!

    a beginner or expert would love this kind of plugin

    regards

    Comment by funnyvideo! — March 11, 2008 @ 3:44 pm

  27. Hello,

    I did already the first step´s, but im stucking :(
    i don´t get this step :

    # Extract the ID fromthe video page url. These look something like: http://youtube.com/watch?v=Krhl2o_uwdc. The bit I put in bold type is the ID.
    # Type [youtube ]Krhl2o_uwdc[/youtube] anywhere in your post. Leave out the space in the first tag.
    # Save and publish the post.

    Where should i post it? in “Beitrag schreiben(write an article)” ?

    i hope somebody could help me … thanks

    Comment by Faro — March 11, 2008 @ 8:18 pm

  28. Hi Faro,

    Yes, the [youtube]id[/youtube] should go in your post. They’ll be replaced with the video when the page is called by a visitor.

    Comment by Roy — March 12, 2008 @ 8:40 am

  29. Nice job! I’ve tested it and it works great! Keep up the good work!

    Comment by Jw Bobbink SEO — March 18, 2008 @ 3:12 am

  30. [...] Youtuber: plugin para insertar videos de youtube [...]

    Pingback by garcía-valenciano » Blog Archive » Wordpress toma las riendas… — March 27, 2008 @ 11:50 pm

  31. This is a great post and have kept it in my bookmarks. Will continue to read it as i’m very new to a lot of the points you mention!

    Thanks though, i’m glad some people share good stuff like this!

    Comment by Bob Mildon — June 9, 2008 @ 2:35 pm

  32. Good Looking and standard plugin for wordpress and as said in above posts nice name too :) Thanks Friend

    Comment by Nate — July 24, 2008 @ 3:43 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Design by Roy Tanck