static void Main(string[] args) { OEmbedEngine engine = new OEmbedEngine(); string result = engine.Parse(@"hello a b c d http://open.spotify.com/track/298gs9ATwr2rD9tGYJKlQR sooooooo so sooo def, this other youtube video here: https://www.youtube.com/watch?v=mGw_pxittJA <p>check this out: http://instagram.com/p/Y_BBAgBs4_/ </p> <b>http://polldaddy.com/p/1323235/ </b> <h3>Colbert Video</h3> http://www.hulu.com/watch/493821 <p>further down my glorious content is this https://speakerdeck.com/chriscoyier/how-to-stay-up-to-date-on-web-technology</p>", 250, 0 ); Console.WriteLine(result); Console.ReadKey(); }
protected override void DoRender(System.Web.UI.HtmlTextWriter output) { if (!string.IsNullOrEmpty(this.Field)) { Sitecore.Data.Items.Item i = this.GetItem(); if (i != null) { LinkField lf = (LinkField)i.Fields[this.Field]; if (lf != null && !lf.IsInternal && !lf.IsMediaLink) { PJones.OEmbed.OEmbedEngine eng = new OEmbedEngine(); string embed = eng.Parse(lf.Url, MaxWidth, MaxHeight); output.Write(embed); } } return; } else { throw new InvalidOperationException("Field property is required. All field web controls require the field name to be set."); } }