Beispiel #1
0
        protected override IEmbeddedResult ProcessUrl(string url)
        {
            int patternIndex;
            var match = Match(url, out patternIndex);

            if (!match.Success) return null;

            var endpoint = string.Format("http://gfycat.com/cajax/oembed/{0}", match.Groups[1].Value);
            var response = JsonConvert.DeserializeObject<OEmbedJsonResult>(_requestService.Get(endpoint));

            var result = new VideoEmbeddedResult(response.Html, response.Width, response.Height, response.Title, response.AuthorName, response.AuthorUrl, "Gfycat", response.ProviderUrl, response.CacheAge, response.ThumbnailUrl, response.ThumbnailWidth, response.ThumbnailHeight);
            result.AdditionalData.Add("Key", match.Groups[1].Value);

            return result;
        }
Beispiel #2
0
        protected override IEmbeddedResult ProcessUrl(string url)
        {
            int patternIndex;
            var match = Match(url, out patternIndex);

            if (!match.Success)
            {
                return(null);
            }

            var endpoint = string.Format("http://gfycat.com/cajax/oembed/{0}", match.Groups[1].Value);
            var response = JsonConvert.DeserializeObject <OEmbedJsonResult>(_requestService.Get(endpoint));

            var result = new VideoEmbeddedResult(response.Html, response.Width, response.Height, response.Title, response.AuthorName, response.AuthorUrl, "Gfycat", response.ProviderUrl, response.CacheAge, response.ThumbnailUrl, response.ThumbnailWidth, response.ThumbnailHeight);

            result.AdditionalData.Add("Key", match.Groups[1].Value);

            return(result);
        }