« Previous pluginNext plugin »

YouTube Plugin

The YouTube Plugin allows you to search YouTube, select a video from the results and add it to your post. You don't need to have a YouTube account. You don't need to edit the b2evolution Html Validator. You don't even need to go to YouTube.com. It's all done from inside your b2evolution backoffice.

Author:Danny Ferguson

YouTube Plugin
This screencap shows the YouTube Plugin in action.

Installation

Requires b2evolution 1.8 or higher

This plugin is installed in the standard way.

  1. Download the zip file from the link below.
  2. Unzip it and upload the folder to your plugins folder.
  3. Go to App Settings > Plugins, and click install next to the YouTube plugin listing.

Usage

Using the plugin is simple.

  1. From the write tab, click the "YouTube" button below the textarea. This will cause the YouTube toolbar to appear.
  2. Enter your search term and click "Go". You can enter the tags you want to search by or the YouTube username of the person who uploaded the video you want to find (or both).
  3. Hover your mouse over the thumbnails that appear to see the title, tags and length. Use the arrows to go to the next page of results.
  4. Click on a thumbnail to add a video to your post. It will add something to your post like this: [youtube]vBt3bFboJio[/youtube] . The renderer portion of the plugin will convert this to the code needed to display the video when your blog post is viewed. Use preview if you want to check the video.
  5. You can add more than one video if you like. When you're finished adding videos, click on the "X" to hide the YouTube toolbar.

If you know the id of your video and don't want to search for it in the toolbar (or can't find it that way for some reason), you can just add [youtube]THE_ID[/youtube] to your post and the renderer will still work.

Other Sites

Although the video search only supports YouTube, you can use this plugin to display videos from other sites, too. Click on the "Other sites" link to get buttons for adding the clips. Click the button for your service, then paste in the id for the clip. You can usually find the id in the url for the video, or in the embed code that the video site provides.

The supported sites are Blip.tv, Current.tv, Daily Motion, Google Video, iFilm, Jumpcut, Revver, vSocial, metacafe and Break.com

  • Metacafe.com works a little differently than the others. Instead of an id for each video, its embed code has to have an id and a filename. The code in your post will look something like this: [metacafe]78597/gov_vs_pres_bush.swf[/metacafe].
  • Similarly, Blip.tv is a bit different, you have to paste in the file name rather than an id number. This filename required can be found by going to the Share section of the particular video, and then under the permalinks tab. You will need to use the one with the extension FLV. Something like [blip]filename.flv[/blip]

Settings

Thumbnails per page:
Choose the number of results per page you want to display. The default is 3, which should fit on one row for most monitor resolutions. If you run at a higher resolution or want multiple rows, you can raise this number.

Previous releases

The previous releases of the YouTube plugin are hosted in the Plugins Repository at: https://sourceforge.net/projects/evocms-plugins/files/youtube_plugin/

Requirements

This plugin requires b2evolution 1.8 or later.

Credits

This plugin was made for b2evoltution by Danny Ferguson

Space Character Fix

Note from Danny: Thanks to Gazugafan who discovered this bug and provided the fix. I've applied it to the plugin and made a new release. I'll leave this section here for a week or two in case anyone has questions about the bug.

I noticed that if you search for a youtube video and include a space character, the search doesn't work at all. I fixed this by doing the following in youtube.js...

line 14 change to (notice the urlencode):

Code

var youtube_url_full = youtube_url + '&yttag=' + urlencode(tag) + '&ytpage=' + page;

after line 28, add a new function as follows:

Code

function urlencode(str) {
  str = escape(str);
  str = str.replace('+', '%2B');
  str = str.replace('%20', '+');
  str = str.replace('*', '%2A');
  str = str.replace('/', '%2F');
  str = str.replace('@', '%40');
  return str;
}

It's not tested very thoroughly, but it seems to work fine for me. Hope it helps!

Available downloads for this plugin:

31 comments

Comment from: Ben borges [Visitor]  
Ben borges

I can’t have my b2evo site to see that there are new plugins in the plugins folder..am i’ missing something ? thanks to any help :)

ps: runing b2evo v 1.8.1-RC

08/26/06 @ 11:54
Comment from: Arturo [Visitor]  
Arturo

The search doesn’t work…

09/01/06 @ 12:24
Comment from: Indigo Black [Visitor]  
Indigo Black

Yay, I can post videos again. It works great. Thanks for taking the time to create it.

09/16/06 @ 18:28
Comment from: Norman Gregory Fernandez, Esq. [Visitor]  
Norman Gregory Fernandez, Esq.

This is a fantastic plugin that works perfectly!!

No hassle to install, no hassle to use. It works!

09/30/06 @ 12:13
Comment from: Martin [Visitor]  
Martin

Hm, unfortunately there is no “Other sites” link I can use to link videos other than YouTube. What is going wrong? Hm…

10/12/06 @ 05:16
Comment from: eric d [Visitor]  
eric d

Looks good. I’m a metacafe fan myself. Any chance that’ll be included in an updated version in the future?

10/30/06 @ 02:16
Comment from: PV [Visitor]  
PV

Is it possible to enlarge daily motion videos ? they ‘re a bit too small with this plug in.

thanx anyway, it works great with other sites!

12/26/06 @ 07:18
Comment from: moviemix [Visitor]  
moviemix

It just works. Great, even.

01/01/07 @ 10:24
Comment from: Toño Guerrero [Visitor]  
Toño Guerrero

Thanks a lot. The plugin work perfect.

01/16/07 @ 10:11
Comment from: Fraser Pearce [Visitor]  
Fraser Pearce

Fantastic plugin. Found a potential problem though… I use Bloglines to monitor feeds, and content added via this plugin doesn’t show up at all. I realise it may be difficult to achieve that, but is a placeholder image possible? BTW I’m using 0.9.5

01/27/07 @ 07:48
Comment from: [Visitor]

I use bloglines, too, and I’ve noticed that. You could add a thumbnail image to the post, but then what about rss readers that do support flash? They’ll be getting less than they were before.

01/27/07 @ 11:47
Comment from: Fraser Pearce [Visitor]  
Fraser Pearce

Hmm… A fair point. I really like bloglines, but its ‘basicness’ is sometimes frustraiting. I can’t think of a good way of doing this for bloglines without hurting more capable systems. hmm….

02/08/07 @ 03:21
Comment from: Scott Kimler [Visitor]  
Scott Kimler

LOL … I thought I’d follow the ‘normal route’ to see if YouTube worked with 1.9.2, but I see there are no less than FIVE comments, awaiting moderation.

Would be nice to have a list of b2evo versions that are “known to work with” a given plugin. :D

-stk

02/08/07 @ 16:16
Comment from: Robert Turrall [Visitor]  
Robert Turrall

This plug-in is excellent - plug it in and it works. I like that. Very nice. Thank you!

05/11/07 @ 10:39
Comment from: Juan Carlos [Visitor]  
Juan Carlos

Need this pluging of youtube for versión 0.9.2 b2evolution … PLEASEEE… Is very Important

06/05/07 @ 22:29
Comment from: Jeff Bailey [Visitor]  
Jeff Bailey

Thumbnail images barely visible in Opera 9.21.

See forum thread: http://forums.b2evolution.net/viewtopic.php?t=11998

07/11/07 @ 15:56
Comment from: Paolo [Visitor]  
Paolo

Very useful plugin.

I’ve added dotSUB video services with minimum effort hacking the code.

07/25/07 @ 03:15
Comment from: jamie [Visitor]  
jamie

Great plug-in. Folly the directions and you’ll be up and running in no time!

Thank you!!

08/28/07 @ 20:56
Comment from: Guitar Guy [Visitor]  
Guitar Guy

Thanks for the plugin!

09/10/07 @ 04:50
Comment from: Marco Kalz [Visitor]  
Marco Kalz

Great plugin Danny. I have modified it a little and enhanced it with Slideshare functionality. You can download the two modified files under the URL above.

09/29/07 @ 17:53
Comment from: jghjk [Visitor]
jghjk

k

12/03/07 @ 16:54
Comment from: Carrie [Visitor]  
Carrie

Great plugin, thanks! =]

01/19/08 @ 17:47
Comment from: aish [Visitor]
aish

gr8 plugin

03/25/08 @ 10:28
Comment from: Clesio [Visitor]  
Clesio

This plugin is excellent. It allows adjustments, as I did. Look at the above address.

08/06/08 @ 11:34
Comment from: jigar [Visitor]  
jigar

Great plug-in. Folly the directions and you’ll be up and running in no time!

12/17/08 @ 10:37
Comment from: http://www.askyourpc.com [Visitor]
http://www.askyourpc.com

This would be a good plugin for some of my blog posts that would best be understood with video explanations.

12/25/08 @ 22:41
Comment from: Avnish [Visitor]  
Avnish

Thanks for the plugin : )

11/05/09 @ 02:08
Comment from: Stefano Luporini [Visitor]  
Stefano Luporini

The plugin doesn’t work anymore!
It happens because it uses old Youtube APIs that are expired on November, 11th.
See http://apiblog.youtube.com/2009/11/final-decommission-notice-for-legacy.html

“Final Decommission Notice for the Legacy YouTube API”

Will you update to the new APIs ? otherwise after the next couple of weeks I could find the way to patch it (now my company is moving, so we are too busy).

The renderer is stil working: I’m posting videos writing directy [youtube]THE_ID[/youtube], after found the IDs from Youtube.

11/25/09 @ 02:09
Comment from: Greg Willson [Visitor]  
Greg Willson

Yikes!

This might be something I’m going to have to fix, because there’s no plugin this wonderful out there, and we need it for the Students at University of Colorado.

Greg

01/22/10 @ 02:36
Comment from: Greg Willson [Visitor]  
Greg Willson

if you take the code linked above and replace it with the contents of _youtube.plugin.php you will have the functionality again that this plugin was so great for!

It should work out of the box, please let me know if you have any problems.

Greg

10/01/10 @ 18:44
Comment from: friv [Visitor]  
friv

Thank you .this is an awesome plugin.

10/11/10 @ 00:20