Introducing oEmbed for EPiServer
Posted on September 25, 2010 by Frederik Vig in ASP.NET, EPiServerA couple of weeks back I added a new EPiServer plugin to EPiCode, oEmbed. The plugin is really simple, but does some cool things. Imagine your editors have some content on YouTube, Amazon, Flickr etc, and they’d like to add it to their EPiServer site. oEmbed makes this really easy, all the editors need to do is paste in the URL of the content they wish to show, could be from Amazon, Viddler or any other service that support oEmbed (here’s a list of supported services), and the plugin will automatically figure out the correct embed code for the content, doesn’t matter if it’s a Flash video or just plain HTML and CSS.
Examples
Add a new dynamic content and paste in the URL
And the result. Pretty cool huh?
This works for a lot of popular services and makes it so much easier than manually copying/pasting the embed code. I encourage you to take a peek at the source code, especially the oEmbedResponse.cs class to see what you get back.
Get started
To get started simply download Geta.oEmbed.dll and add it to your sites bin folder (note that you need to unblock it). Then you need to register the dynamic content in episerver.config:
<dynamicContent> <controls> ... <add description="Displays an oEmbed object on the page" name="oEmbedPlugin" type="Geta.oEmbed.DynamicContent.oEmbedPlugin, Geta.oEmbed" /> </controls> </dynamicContent> |
That’s it! You can now use oEmbed both as a dynamic content plugin and as a custom property.
Daniel Berg says:
Post Author September 25, 2010 at 14:31That’s really slick, Frederik. Great work! 🙂
Tom Stenius says:
Post Author September 27, 2010 at 02:52Hey Frederik – nice work! This will look awesome in demos here in Australia & NZ! Thanks!
Fredrik Josefsson says:
Post Author September 27, 2010 at 14:29This looks really nice, will have to try this out. 🙂
Martin S. says:
Post Author September 27, 2010 at 19:54Thanks for this one! Will def. come in handy 🙂