WordPress – Getting the oEmbed whitelist providers

I wanted to get the list of providers from the oembed whitelist to use in the NFB Video Plugin’s next update for WordPress 3.0.

The global $OEMBED is the variable that stores all my other variables in the plugin, that’s why it’s there.

There’s probably a function somewhere that does this, but I didn’t find it. So, if there’s anyone else who was having difficulty with it, as a temporary solution you could go with something like this:

$INCLUDE_EXTERNAL_BASE_PATH = dirname(dirname(dirname(dirname(__FILE__))));
require_once($INCLUDE_EXTERNAL_BASE_PATH . ‘/wp-includes/class-oembed.php’);

function populate_list_from_wp_oembed_whitelist(){

global $OEMBED;
$wp_oembed = new WP_oEmbed();

$OEMBED->whitelist = array();

foreach($wp_oembed->providers as $provider=>$oembed_url):
array_push($OEMBED->whitelist, $provider);
endforeach;

return $OEMBED->whitelist;
}

$providers = populate_list_from_wp_oembed_whitelist();

** I would have put it in code tags, but apparently it’s not working correctly at the moment.

WordPress Plugin Issues – Infinite Scroll

This is just a small post to help people out if they have an difficulty getting this particular plugin to work. After the time I wasted, trying to figure it out, I thought I’d go ahead and save you some time.

1. Make sure that wp_footer() is right before your end body tag. <?php wp_footer(); ?>
2. Make sure that there is a container that holds ONLY your posts. (usually #content)
3. Make sure that the posts have a class in common. (usually .post)
4. Make sure navigation has a class or id. (usually #navigation or .navigation)

Reload your homepage and you should see it adding more posts when you scroll down the page.

Small Update to the NFB Video Plugin for WordPress

NFB Video Plugin

Just made a small change to the NFB Video Plugin for WordPress, the width/height weren’t setting correctly when you updated from an older version that used different variables.

Now the default is set to 516-337, and it should also set it to that height if your fields are empty for width/height. It’s just to avoid the player being a tiny little mush ball of uselessness cause the width wasn’t defined.

There was mention that the plugin makes it impossible to add/crop images in the uploading process, I’m not sure how that’s happening just yet, if anyone is having this issue can you tell me where in the process you see the fail? I’ll continue investigating in the meantime.

NFB Video Plugin – Update

Firstly, I’d like to apologize to booking for this taking so long. The update is coming up, I had a few days of issues with regular expressions and things didn’t go so well, but now it’s on track.

The main reason for the push on this update prior to my other changes is that some people have been having difficulty with the simple_html_dom.php file and I apologize for that. I was unable to get a hold of the person who made it, so I had to restructure my plugin for independence. Thank you to Booking for helping me with validating that the snippet worked.

Left to do : Add CSS to the admin / Almost done

Newly added : You can include the description of any National Film Board of Canada film that you link to via the oembed. If YouTube and Vimeo throw descriptions into their oembed xml files, then all will go well with their videos too. The element is video_description if they’re curious of if you know someone there and want to harass them to put it.

Newly updated : The layout is a little different on the front end now. There’s the title (an h3), followed by the embed code (which is set to the width/height of your choice), followed by the caption (Author/Provider) and then in a blockquote, there is a description. They all have their own individual CSS though, which is why my first point is not complete yet. Last minute change.

New admin : The administration panel is completely revamped. It has the colours of the NFB website and now shows you the last three films that were added to the NFB website, if you change the admin language, it will show you the last three French films as well. The oe links are provided underneath those videos if you’d like to add it to a post.

Future changes that will come up in the next update :
1. A button in the post page that will let you preview the embed before you insert it in the post.
2. Each film will have its own individual width/height set aside from the default if you wish to make an exception.
3. Embeds will be capable of being saved in the database so you aren’t having to make calls all the time for the information. (optional; sorry I couldn’t fit it in this patch)
4. Visibility of all posts that contain oembeds so you can keep track of which films you’ve already added (optional)
5. Separate CSS layout for all embeds.
6. Ability to replace an oe link with the actual embed. (Once this is done however, it’s irreversible. This is for the more determined folk.)

There will be more to come, but those are some of the changes in the upcoming fixes. Look for the update on at http://wordpress.org/extend/plugins/nfb-video-plugin/ within the next 48 hours.

Viper Video Quicktags – MOV Video Doesn’t Work But Sound Does?

Isn’t this an annoying bug? Just when you think your troubles are over and you’ve got the file all figured out, it goes and denies you the video portion of your video.

This really isn’t Viper’s fault, but one parameter in particular seems to have a problem with a lot of MOV files.

So go into the plugin’s file and find the following bit of code:

myQTObject.addParam(“scale”, “aspect”);

Then comment it out :

/*myQTObject.addParam(“scale”, “aspect”);*/

Save and then refresh your blog page and see if it shows your video now.

If so, YAY.

If not, I’m sorry, it’s all I found.

Hope it helps!

YouTube with NFB Video Plug-in

Well, it’s not the big grand update that you’ve been waiting for with the NFB’s Video Plug-in, but I’ve made a small addition to the current version available.

EDIT : Let’s also give you a link…duh…I’m such a tool sometimes lol
You can download it at this link on WordPress.org.

You can now embed YouTube videos in your blog posts the same way you would with NFB films and Vimeo.
“oe” followed by the link.

oehttp://www.youtube.com/watch?v=lu_2Fxp_e0s&feature=PlayList&p=3F10961D41198147&index=0&playnext=1

and you’ll get something like this :

[Invalid Link] http://www.youtube.com/watch?v=lu_2Fxp_e0s&feature=PlayList&p=3F10961D41198147&index=0&playnext=1

Enjoy!

NFB Video Plugin – Changes to Come

Working on the next change to the NFB Video Plugin. I’m writing it here, because to be honest we don’t have our official page up yet. Once the page is done, you’ll find more information on the NFB.ca website. Until then! This is what’s coming up…

An issue that came up a few times is how many times the links are being read by the plug-in. Correct, it is a lot of times. So, we’re going to cut down on that if the user so chooses. So the question is…do you want to keep track of your embeds?

1 – I don’t want to keep track of them.
[WARNING : Choosing this option means the plug-in will verify the link every time.]
2 – I’d like to keep them, but leave my oe links tidy when editing my posts.
3 – I’d like to automatically replace my oe links by the embed code
[WARNING : If you don't know HTML or you don't care to go back and have to fix individual posts, you should set your caption options first.]

The second addition I’d like to add in this version hopefully is a separate tab where you can see a list of the last 10/20/30/50/100 links that you embedded on your blog, what post it belongs to and the date. For multiple links on your site, it will indent and show them in Maroon. Why do I want to do this? It’s so you can see if you have duplicate content on your site. Which you don’t want if you like SEO.

Anyways, update more later on the progress.

NFB Video Plugin – Woot finished my plugin!

WARNING : Currently only for NFB (National Film Board of Canada) and Vimeo. As more video sites add oEmbed to their sites and allow auto-discovery, you can use their URLs too.

Woot! Okay, so I finally finished the first version of my plugin. It’s for the National Film Board of Canada, so it’s not hosted with me, but I’ll give you the links you need for it!

Firstly, if you want to download the zip, you’ll find it here.

Basically how it works, you extract it to your plugins directory on your WordPress, activate it, then in settings, you can modify the width/height and let the plugin know if you want to show title/author/provider of the video.

To use it. You post a URL of a film page from http://www.nfb.ca/ or from http://www.vimeo.com/ and the plugin will read the URL when you load the post. It should not mess with URL’s in a link and links without oembed will not try to show the video.

Will be presenting at Wordcamp Montreal 2009.

To see the download/upload the code here.

To find out more about what oEmbed is, visit the website.