/// <summary>
        /// Gets a media from the specified <var>JsonObject</var>.
        /// </summary>
        /// <param name="obj">The instance of <var>JsonObject</var> to parse.</param>
        public static InstagramMedia Parse(JsonObject obj)
        {
            if (obj == null)
            {
                return(null);
            }

            JsonObject comments = obj.GetObject("comments");
            JsonObject likes    = obj.GetObject("likes");

            string type = obj.GetString("type");

            InstagramMedia media = null;

            if (type == "image")
            {
                media = new InstagramImage(obj);
            }
            else if (type == "video")
            {
                media = new InstagramVideo(obj)
                {
                    Videos = obj.GetObject("videos", InstagramVideoSummary.Parse)
                };
            }

            if (media != null)
            {
                media.Id           = obj.GetString("id");
                media.Type         = type;
                media.Tags         = obj.GetArray("tags").Cast <string>();
                media.Created      = SocialUtils.GetDateTimeFromUnixTime(obj.GetInt64("created_time"));
                media.Link         = obj.GetString("link");
                media.Filter       = obj.GetString("filter");
                media.CommentCount = comments.GetInt32("count");
                media.Comments     = comments.GetArray("data", InstagramComment.Parse);
                media.LikeCount    = likes.GetInt32("count");
                media.Likes        = likes.GetArray("data", InstagramUserSummary.Parse);
                media.Images       = obj.GetObject("images", InstagramImageSummary.Parse);
                media.Caption      = obj.GetObject("caption", InstagramComment.Parse);
                media.User         = obj.GetObject("user", InstagramUser.Parse);
                media.Location     = obj.GetObject("location", InstagramLocation.Parse);
                media.UsersInPhoto = obj.GetArray("users_in_photo", InstagramTaggedUser.Parse);
            }

            return(media);
        }
 /// <summary>
 /// Gets a video from the specified <var>JsonObject</var>.
 /// </summary>
 /// <param name="obj">The instance of <var>JsonObject</var> to parse.</param>
 public new static InstagramVideo Parse(JsonObject obj)
 {
     return(InstagramMedia.Parse(obj) as InstagramVideo);
 }
 /// <summary>
 /// Gets an image from the specified <var>JsonObject</var>.
 /// </summary>
 /// <param name="obj">The instance of <var>JsonObject</var> to parse.</param>
 public new static InstagramImage Parse(JsonObject obj)
 {
     return(InstagramMedia.Parse(obj) as InstagramImage);
 }