Exemple #1
0
 public static void OnVideoSuccessTrigger(string json)
 {
     if (_onVideoSuccessAction != null)
     {
         var result = VideoPickResult.FromJson(json);
         _onVideoSuccessAction(result);
         _onVideoSuccessAction = null;
     }
 }
        public static VideoPickResult FromJson(string json)
        {
            var videoResult = new VideoPickResult();
            var dic         = Json.Deserialize(json) as Dictionary <string, object>;

            videoResult.OriginalPath = dic.GetStr("originalPath");

            videoResult.PreviewImagePath               = dic.GetStr("previewImage");
            videoResult.PreviewImageThumbnailPath      = dic.GetStr("previewImageThumbnail");
            videoResult.PreviewImageSmallThumbnailPath = dic.GetStr("previewImageThumbnailSmall");

            videoResult.DisplayName = dic.GetStr("displayName");
            videoResult.Width       = (int)(long)dic["width"];
            videoResult.Height      = (int)(long)dic["height"];
            videoResult.Orientation = (int)(long)dic["orientation"];
            videoResult.Size        = (int)(long)dic["size"];
            videoResult.CreatedAt   = CommonUtils.DateTimeFromMillisSinceEpoch((long)dic["createdAt"]);

            return(videoResult);
        }