Embedding third party media in Umbraco

Since Umbraco v4.9 embedding third party media in the RTE has gotten a lot easier, it’ just a matter of supplying the Url to the video/image/sound/poll/… you want to add setting the size and hitting insert!


This is done by making use of the oembed format so every site that support the format can be supported by the dialog in a minute  (if it isn’t already) Smile

All this is setup in the new config file /config/EmbeddedMedia.config, for each supported third party site there is an entry in the config file

  <!-- Youtube Settings -->
  <provider name="Youtube" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, umbraco">
    <requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco">
      <param name="iframe">1</param>
      <param name="format">xml</param>

The provider that needs to be used (most of the time it’s oembed), a regex that will match the supported urls, the api endpount for the oembed stuff and some optional request params if needed.

So if a third party site supports oembed and isn’t supported by the insert third party media dialog yet it’s just a case if adding an entry to the config file

But the implementation isn’t fixed to oembed it’s also possible to plug in custom providers that don’t make use of the oembed format

Look at the following entry for twitgoo

  <!-- Twitgoo Settings , not an OEmbed one -->
  <provider name="Twitgoo" type="Umbraco.Web.Media.EmbedProviders.Twitgoo, umbraco">

That makes use of a custom provider that looks like

using HtmlAgilityPack;
namespace Umbraco.Web.Media.EmbedProviders
    public class Twitgoo : AbstractProvider
        public override bool SupportsDimensions
                return false;
        public override string GetMarkup(string url, int maxWidth, int maxHeight)
            var web = new HtmlWeb();
            var doc = web.Load(url);
            var img = doc.DocumentNode.SelectSingleNode("//img [@id = ‘fullsize’]").Attributes["src"];
            return string.Format("<img src=\"{0}\"/>",

Which will basically search for the element with id full-size and return an image using the src attribute of the full-size element found.

So you can also write your own providers for sites you wish to support Smile

5 Comments so far

  1. Bjørn Fridal on October 24th, 2012

    Great Tim. Its really neat to see useful features like this directly in Umbraco. Even though several packages for this already exists, supporting Oembed out of the box, will be quite handy.


  2. Sandor Voordes on October 1st, 2014

    Hi Tim,

    Old post, new problem though. Our hosting environment can only communicate with the internet through a proxy. How can I set the proxy location for the OEmbed to communcate through. This needs to be set on the underlying webrequest or do you know a global way to have all webrequest in the app use a proxy?


  3. Tim Geyssens on October 1st, 2014

    @Sandor better create this as an issue on the issue tracker since it will need to be handled in the core

  4. Rasmus on December 16th, 2014

    Hi Tim,

    I’ve tried your non-OEmbed solution. But it doesn’t work for my url. I’m not allowed to share the url.

    Has anything changed since then?

  5. agence web Lille on March 14th, 2021

    Bon article. j’apprécie bien souvent votre site internet

Leave a Reply