protected virtual OEmbedResult GetEmbedResult(int width, int height)
 {
     BaseProvider provider = GetEmbedProvider();
     if (provider != null)
     {
         return provider.GetEmbedResult(URL);
     }
     else
     {
         OEmbedEngine eng = new OEmbedEngine();
         return eng.ParseURL(URL, width, height);
     }
 }
Example #2
0
        protected virtual OEmbedResult GetEmbedResult(int width, int height)
        {
            BaseProvider provider = GetEmbedProvider();

            if (provider != null)
            {
                return(provider.GetEmbedResult(URL));
            }
            else
            {
                OEmbedEngine eng = new OEmbedEngine();
                return(eng.ParseURL(URL, width, height));
            }
        }
Example #3
0
        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();
        }
Example #4
0
 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.");
     }
 }
Example #5
0
		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.");
			}
		}