-1

Is there any way to get the thumbnail from server side call?

The only method that I researched is:

$.getJSON('http://www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', { format: "json" }, function (data) {
        $(".thumbnail").attr('src', data[0].thumbnail_medium);
    });

Is there a way to make the same call from code behind? or is there a single URL call like in youtube

img.youtube.com/vi/{0}/0.jpg
4

1 回答 1

0
  1. 项目清单

我从后面的代码中找到了一种方法:

 public static string GetVimeoPreviewImage(string videoId)
 {
     var imageUrl = string.Empty;
     try
     {
         var doc = new XmlDocument();
         doc.Load("http://vimeo.com/api/v2/video/" + videoId + ".xml");
         var root = doc.DocumentElement;
         if (root != null)
         {
             var selectSingleNode = root.FirstChild.SelectSingleNode("thumbnail_medium");
             if (selectSingleNode != null)
             {
                 var vimeoThumb = selectSingleNode.ChildNodes[0].Value;
                 imageUrl = vimeoThumb;
                 return imageUrl;
             }
         }
     }
     catch (Exception ex)
     {
         var message = string.Format("{0} Exception: {1}", typeof(VideoHelper).FullName, ex.Message);
         Log.Error(message, typeof(VideoHelper));
     }
     return imageUrl;
 }
于 2015-08-26T17:20:13.550 回答