Smart Youtube

Smart Youtube is a WordPress Youtube plugin that allows you to easily insert Youtube videos/playlists into your post, comments and in your RSS feed. The plugin is designed to be small and fast and not use any external resources.

From version 2.0 Smart youtube also supports playback of high quality videos, works on iPhone, produces xHTML valid code (unlike YouTube embed code), allows you to view videos in fullscreen and most recently has support for YouTube playlists.

The videos will be embedded in your RSS feed as well, and if this is not support by the reader you can choose to have video link and/or video preview screenshot displayed instead.

Main Features

  • Embed YouTube videos with ease
  • Embed YouTube playlists
  • Supports latest high quality video protocols (360p and HD quality 720p)
  • Allows full YouTube customization (colors, border, full screen...)
  • Supports video deep linking (starting at desired point with &start=time parameter, use &start=num parameter)
  • Works on iPod and iPhone
  • Provides a sidebar widget for videos as well
  • Produces xHTML valid code
  • Very fast and light, no extra scripts needed

Example

You can discuss all plugin related issues in the wordpress plugin forums.

Screenshot

smarttube screenshot 1 Smart Youtube

Download

dl Smart Youtube

donate Smart Youtube

Installation & Usage

  1. Upload the whole plugin folder to your /wp-content/plugins/ folder.
  2. Go to the Plugins page and activate the plugin.
  3. Use the Options page to change RSS feed options
  4. When you want to display Youtube video in your post, paste the video link with httpv:// (notice the 'v')

Example: httpv://www.youtube.com/watch?v=00000000
0000000 part is your video REF#

The video will be automatically embedded to your post in the proper way.

If you want want to display a high quality video then just use httpvh:// instead.

If you want to post a HD (DVD quality, 720p) quality video you would use httpvhd:// ('vhd' for video high definition)

To embed a playlist use extension 'vp' (eg. httpvp://www.youtube.com/view_play_list?p=528026B4F7B34094)

To use video deep linking just add &start=time parameter at the end of url. For example httpv://www.youtube.com/watch?v=OWfksMD4PAg&start=30 will start the video 30 seconds in.

Additionally, you can set how do you want the video to be displayed in your RSS feed. Smart Youtube can show the preview image of the video (automatically grabbed from Youtube), the link to the video, or both. I recommend enabling only the preview image.

Changelog

v3.2
- Added title to widget, fixed HTML code issue with widget

v3.1.1
- param closed properly for HTML validation (thanks Jan Eberl)

v3.1
- wmode transparent parameter updated to better handle transparancy

V3.0

- Added video template, option to set sidebar video size, fixed sidebar widget code, fixed video syntax issue
v2.8
- Supports Playlists

v2.7
- Added support for sidebar widget videos

v2.6:
- Added option to disable search box

v2.5:
- Support for 720p HD (DVD quality) YouTube videos. Use httpvhd://

v2.4:
- Supports video deep linking. Just add &start=time parameter at the end of url. For example httpv://www.youtube.com/watch?v=OWfksMD4PAg&start=30 will start the video 30 seconds in

v2.3:
- xHTML valid code is now an option because it breaks videos in some browsers and feeds

v2.1:
- Smart Youtube videos are compatible with iPhone.
- Fullscreen enabled

v2.0:
Suport for high quality videos from youtube

v1.91:
Rewritten old parts of plugin and general tweaks.

v1.9:
Added video autoplay option.

v1.8:
Solved problem with HTML validation, added full video in RSS feed.

v1.6:
Solved problem with WordPress handling special characters.

Extra

503 Comments

  1. Edward Owen
    Oct 20th, 2009

    Love this plug in!

    Question is, where do I make the adjustment to change the size of the embedded YouTube video?

    Thanks again!

  2. Randy
    Oct 17th, 2009

    I am Having a problem with the video playing. It says: Embedding disabled by request Watch on Youtube. Whats up with this.

  3. roxane
    Oct 9th, 2009

    Thanks for your work, this plugin is really cool !

    Can you (or someone) help me use the widget function in my template files ?
    This is what I did in my code (that did not work) :

    "my YT link with the v added",
    "yte_title" => "the title",
    "before_widget" => "",
    "before_title" => "",
    "after_widget" => "",
    "after_title" => ""
    );
    yte_widget($videos);
    ?>

    Of course I miss something for i'm not a php master !!!

  4. Giancarlo Viterbo
    Oct 1st, 2009

    Thanks for this! I'll use this one on my site! :)

  5. Davies Lim
    Sep 22nd, 2009

    Currently using this plugin. This is the easiest method to add youtube videos on my website. I've tried every other technique but smart youtube is just clean and easy to work with. Centering is as easy as adding a tag to the text!

  6. George
    Sep 17th, 2009

    Great plugin, unfortunately it doesn't work with IE8.

  7. Deniz
    Sep 16th, 2009

    In my country ( Turkey ) youtube is forbedden . We can access youtube with adding all youtube ip's to the hosts file . In my blog i have a post about that . How can i add a note to my guests and link that to my youtube post just before the video ? Which file and line do i need to edit ?

  8. bob
    Sep 15th, 2009

    why is the hd clip so small witht he plug in when its almost a full 1024 browser width in youtube? I see no option to change its size either?

  9. Caio Costa
    Sep 13th, 2009

    Still not working on IE8, but this plugin is waaaaaaaaay GREAT.

  10. Jamie
    Sep 11th, 2009

    Hello, How do you embed this plugin in the sidebar without using the dynamic sidebar widget?

  11. Deniz
    Sep 11th, 2009

    I'm trying to embed http://www.youtube.com/watch?v=QGamSgt5nF0 in hd . i'm adding
    httpvhd://www.youtube.com/watch?v=QGamSgt5nF0 i can make it fullscreen i can see hd button . but its not starting in hd . but when i click hd its okay . it should start with hd isnt it ?

    • dave
      Sep 11th, 2009

      use this instead
      httpv://www.youtube.com/watch?v=QGamSgt5nF0&hd=1
      apparently comments have to be 7 words long so this is just filler

  12. FDC
    Sep 5th, 2009

    i trying use your plugin.. its great plugin.. but i have some trouble..

    if i you browser IE this plugin worked good.. but if i see with chrome or mozila video cant play. and automatic open new page "nothing found" page. (http://blog.foreverdancecenter.com/%3C!--%20Smart%20Youtube%20--%3E%3Cspan%20class= )

    like that.. can anybody helps? thanks a lot..

  13. john
    Aug 30th, 2009

    is it possible to use tis to place more than one video in the sidebar? I can only use the widget once?

    thanks for your help.

    -john

  14. Rbt Hilts
    Aug 28th, 2009

    Hi,

    I really like this plugin, but when the controls are used on the embedded video a new windows tab is opened in the browser, showing the original Youtube site.

    in this normal?

  15. Adorian
    Aug 26th, 2009

    It works perfectly! Is there any solution to import the comments from that youtube link?

  16. FONDA
    Aug 24th, 2009

    Outstanding! Thank you! Let me know when you get the source code to change the world. I will need a snippet!

    Cheers,
    FONDA

  17. 2cool
    Aug 22nd, 2009

    nice plugin
    is there a way to implement this in templates ?

  18. Liseth
    Aug 18th, 2009

    THANKXX so much...finally easy going posting with you tube vids!!!!

  19. vafa
    Aug 17th, 2009

    hi
    Youtube is denied to access in my country
    i have a lot Youtube video placed on my site with Smart Youtube
    now i can access to Youtube.com with it's IP Address (64.15.120.233)
    how can i use that IP instead of Youtube.com Domain?
    this means i need a change in plugins for change the video address in WP pages(not in admin panel and database)
    tanks for Smart Youtube

  20. Dainis W. Michel
    Aug 11th, 2009

    pulled the use of smart youtube on my blog. i'd love to use it again...

  21. Dainis W. Michel
    Aug 10th, 2009

    Tried using rm_wpautop plugin on Smart YouTube posts, didn't work...two videos and code sticking out...gotta start embedding the code itself...but I'll be looking for a solution here.

    Cheers,
    Dainis

  22. Dainis W. Michel
    Aug 10th, 2009

    hmm...turned off xHTML validation and now I get two videos plus the extra code sticking out. Trying to figure somethin' out :-)

  23. Dainis W. Michel
    Aug 10th, 2009

    rel='nofollow'> sticks out, and then the formatting of certain pages (if there is more text below SmartYoutube) gets messed up. Works fine if I just embed the YouTube code, but I have httpv in over 100 places on my blog.

    Any thoughts on a fix? I tried to put the YouTube URL in as "raw" html using the Raw Code Injector. I think this has something to do with autop.

    Kinda don't want to go through my whole site and replace all instances of httpv with the whole YouTube code.

    Best,
    Dainis

  24. XSportSeeker
    Aug 8th, 2009

    For users who migrated to self-host (from Wordpress.com to Wordpress.org):

    If you want the [youtube=*youtube-address*] tags to work with Smart YouTube, I'm writting some lines of code to insert to the Smart YouTube plugin.

    On smartyoutube.php, search for the following line:

    return $the_content;

    Now, add the following BEFORE it:

    // to work with migrated blogs from Wordpress.com replacing [youtube=youtubeadresss]
    if(strpos($the_content, "http")!==FALSE ) {
    preg_match_all("/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/)([a-zA-Z0-9\-\_]{11})([^<\s]*)\]/", $the_content, $matches, PREG_SET_ORDER);
    foreach($matches as $match) {
    $the_content = preg_replace("/\[youtube\=http:\/\/([a-zA-Z0-9\-\_]+\.|)youtube\.com\/watch(\?v\=|\/v\/)([a-zA-Z0-9\-\_]{11})([^\s<]*)\]/", yte_tag($match[3], '', $match[4], $side), $the_content, 1);
    }
    }

    And voilá!
    Notice this is a quick mod, and since I'm not a pro PHP coder, I'm not completely shure if this will affect other things... but I guess not.
    Also: All [youtube=] tags will be treated as standard non-HD videos.

    Another sollution is using something like the Search and Replace plugin (http://wordpress.org/extend/plugins/search-and-replace/) to replace all tags like:
    "[youtube=http://" for "httpv://" and "]" for ""
    The only problem is that you'll end up with no "]" on your posts, even those that has nothing to do with YouTube tags.

    I hope everyone understands what I'm saying...
    []'s

    • Aug 19th, 2009

      Nice patch, I have included it for v3.3

  25. HK
    Aug 4th, 2009

    For some reason the Smart Youtube plugin prevents the TinyMCE Advanced editor plugin from loading properly in the edit-pages.php dashboard page (on all other pages including editing posts, there's no problem). I am not running any other plugins, so I know SY is at fault just by disabling it.

Have your say

Your email is never published nor shared. Required fields are marked *

*
*

This site rewards regular commentators with do-follows links to their site.

Subscribe without commenting

About Vladimir

vladimir prelovac Hi! My name is Vladimir Prelovac. I am a computer engineer by profession and an adventurer by state of mind.

"I would love to change the world, I just don't have the source code yet."

Books by Vladimir

WordPress Plugin Devleopment Book WordPress Plugin Development: Beginner's Guide

Published by Packt Publishing, available online through Amazon. Click the image for more information.

Consulting Services

Professional WordPress solutions based on custom developed plugins and themes

Expert on-site WordPress SEO consulting and an 'out-of-the-box thinking' approach to problems