The 23 Developer Blog

Scroll to Info & Navigation

Using oEmbed with 23 Video

Quite a while ago we added support for oEmbed to 23 Video. This makes it easy to turn a URL from either service into a piece of HTML which is can be embedded into a web site or a blog. For example, this makes it easy to embed video into a WordPress blog post by simply pasting a link to a video into your editor.

I won’t dig too deeply into the technical stuff since there isn’t much to say: oEmbed allows a URL or a link to be turned into a full piece of HTML in a structured fashion, and the endpoint you’ll need to use is http://your.domain.com/oembed.

Interestingly, from WordPress 2.9 and onwards you can use oEmbed in your blog posts. For example, you can put in a link to a public video into the editor and have it be displayed not as a link, but as a video scaled to fit your design. For administrators of WordPress sites this trick is also a way to control which content can safely be embedded into posts — even if you don’t allow , or , tags in posts.

To set this up, you’ll need to add a little piece of code to your WordPress installation; for example in the bottom of .wp-includes/media.php. The code line varies with the domain you’ve chosen for your video site, but something like this would do the trick:

wp_oembed_add_provider(‘http://tv.dmi.dk/*’, ‘http://tv.dmi.dk/oembed’ );

After this a video from the site you’ve set up is embedded simply by inserting a link into your blog post.

Recent comments

Blog comments powered by Disqus