WordPress YouTube Sidebar Video Plugin

This is a plugin based on the YouTube widget. It’ll display a YouTube video, most likely in your sidebar, by calling the youtube function which you can specify the url, width, height, and if it’ll autoplay. It’s not much, at all, but meh.

Download youtube-plugin.zip (youtube-plugin.tar.gz)

This plugin is one function called youtube that will display a YouTube video. It’s pretty much the same as copying the embed code from YouTube, but will allow you to change the width and height much easier.

I’m not going to go too much into this, so here’s the whole calling it premise. You would place this in your template in php tags.

youtube(uri[,width,height[,autoplay]])

Display a video with default width and height (250×165)
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY")

Display a video with custom width and height (500×330)
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY",500,330)

Display a video with default width and height (” will cause it to default), but autoplay
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY","","",TRUE)

Display a video with custom width and height and autoplay
youtube("http://www.youtube.com/watch?v=AYxu_MQSTTY",500,330,TRUE)

Download youtube-plugin.zip (youtube-plugin.tar.gz)

10 Comments

  1. I’ve updated to wordpress 2.5 and the youtube plugin doesn’t work. I have tried this one but putting the line youtube(“http://www.youtube.com/watch?v=AYxu_MQSTTY”,500,330) in a text sidebar box doesn’t work.
    This line is not working.
    Any idea??

  2. This works with WP to 2.6 ! It is even better than the famous Daikos Widgets Youtube which spend days to get it to work but fail. With this Youtube sidebar I just install and paste the “youtube..” code provided with and everything works as said. check my site to prove it. http://www.moremusic.co.th

    Thanks

  3. I don’t really understand calling part :

    You would place this in your template in php tags.

    youtube(uri[,width,height[,autoplay]])

    it looks like

    ?
    anyway then I don’t know where to put it to get it working. Hopefully You can help and answer..thanks!

  4. Thanks for fast response, but can I ask You to be a little more detailed?

    I mean 4th step – where You call plugin.
    I did first three steps (bah..:)) and then I open my sidebar.php file – and add this code:
    1.to call
    2.to get video

    Can I ask what am I doing wrong, because now I am just getting fatal error or if I don’t add php tags, I am just getting text on sidebar.

  5. Is the plugin enabled? What’s the error message?

    You have to put it in php tags, since you’re calling the php function in the plugin.

    Edit- Nevermind. You commented again while I was writing this.

  6. Fantastic Plugin. Easy-Peacy-Lemonsqueezy to install but……

    Is it possible to let let is “stick” where it is no mather if you change pages or clink on another link?

    My plan is to have a sertain musicvideo playing in the background when the user is browsing around on the page and don’t cut the music when changing to another post or something like that