Embed external videos easily with the new WordPress
(Via the WordPress Codex: http://codex.wordpress.org/Embeds )
Starting with WordPress 2.9, it’s super easy to embed videos, images, and other content into your WordPress site.
In A Nutshell
You could always easily embed videos from extrenal sites using the plugin Vipers Video’s quicktags.
We just upgraded to the newset version of wordpress and now all you need to do to embed something into a post or page is to post the URL to it into your content area. Make sure that the URL is on its own line and not hyperlinked (clickable when viewing the post).
Check out this cool video:
http://www.youtube.com/watch?v=nTDNLUzjkpgThat was a cool video.
You can also opt to wrap the URL in the
shortcode. It will accomplish the same effect, but does not require the URL to be on its own line and the “Auto-embeds” setting.
The easy embedding feature is mostly powered by oEmbed, a protocol for site A (such as your blog) to ask site B (such as YouTube) for the HTML needed to embed content (such as a video) from site B.
oEmbed was designed to avoid having to copy and paste HTML from the site hosting the media you wish to embed. It supports videos, images, text, and more.
Can I Use Any URL With This?
Not by default, no. WordPress will only embed URLs matching an internal whitelist. This is for security purposes.
Okay, So What Sites Can I Embed From?
You can use all of these:
- Flickr (both videos and images)
- Google Video
- WordPress.tv (only VideoPress-type videos for the time being)
How Can I Add Support For More Websites?
Adding support for an additional website depends on whether the site supports oEmbed or not.
Adding Support For An oEmbed-Enabled Site
If a site supports oEmbed, you’ll want to call
wp_oembed_add_provider() to add the site and URL format to the internal whitelist.
Adding Support For A Non-oEmbed Site
You’ll need to register a handler using
wp_embed_register_handler() and provide a callback function that generates the HTML.
What About oEmbed Discovery?
The oEmbed implementation in WordPress has discovery disabled. By default, you can only embed from websites that are listed on the internal whitelist. This is to prevent accidental embedding from malicious websites.
However if you feel you are knowledgeable enough to avoid this, you can give
unfiltered_html users (Administrators and Editors) the ability to embed from websites that have oEmbed discovery tags in their
<head>. You merely need to install Enable oEmbed Discovery plugin.
- Summary of this feature by the author of this code
- Webmonkey guide to oEmbed
- Official oEmbed website (technical details of the spec)
|This entry was posted by Harry on 20 January, 2010 at 16:39, and is filed under Manual, Upgrades. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site.|
No comments yet.
No trackbacks yet.
about 9 years ago - No comments
So you opened your new blog, turned on the anti-spam plugin and now what? How do you write a page, change your theme etc? You can just try out a lot of things by going in your admin menu (yourname.biketravellers.com/wp-admin) and browsing through the different menu options. You can also check out this excellent overview…