Beispiel #1
0
        public ActionResult GetTimeLine(string usertoken, string guid, string siteCode = "")
        {
            ResponseMessage <ObjectInfo> r = new ResponseMessage <ObjectInfo>();
            EditorMediaJson response       = new EditorMediaJson();

            r = AppContext.Current.FolderService.GetClipInfo(usertoken, guid, "64", "http", siteCode);
            Logger.Trace("获取素材信息:usertoken={0},guid={1}\n", usertoken, guid);
            Logger.Trace("执行结果:code:{0},msg:{1}\n", r.Code, r.Msg);
            return(Json(r, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        /// <summary>
        /// 发起合成
        /// </summary>
        /// <param name="requst"></param>
        /// <returns></returns>
        public ResponseMessage SendToRender(string usertoken, string PEFSourcePath, string entityName, string objecttype, string folderPath, EditorMediaJson requst, string transCodeType = "", string siteCode = "")
        {
            ResponseMessage r   = new ResponseMessage();
            string          url = ApiContext.RenderApiUrl + "/entity/program/SubmitRender";

            NameValueCollection q = new NameValueCollection();

            q.Add("usertoken", usertoken);
            q.Add("PEFSourcePath", PEFSourcePath);
            q.Add("entityName", entityName);
            q.Add("objecttype", objecttype);
            q.Add("folderPath", folderPath);
            q.Add("transCodeType", transCodeType);
            q.Add("siteCode", siteCode);
            r = ApiContext.Client.Post <ResponseMessage>(url, JsonHelper.ToJson(requst), "Post", q);
            Logger.Trace("执行结果:url:{0},siteCode:{3},code:{1},msg{2}\n", url, r.Code, r.Msg, siteCode);
            return(r);
        }
Beispiel #3
0
        /// <summary>
        /// 生成PEF
        /// </summary>
        /// <param name="requst"></param>
        /// <returns></returns>
        public ResponseMessage <RenderPefResponse> RenderPEF(string usertoken, string title, EditorMediaJson requst, string siteCode = "")
        {
            ResponseMessage <RenderPefResponse> r = new ResponseMessage <RenderPefResponse>();
            string url = ApiContext.RenderApiUrl + "/entity/program/renderpef";//接口参数变更

            NameValueCollection q = new NameValueCollection();

            q.Add("userToken", usertoken);
            q.Add("pefName", title);
            q.Add("siteCode", siteCode);
            r = ApiContext.Client.Post <ResponseMessage <RenderPefResponse> >(url, JsonHelper.ToJson(requst), "Post", q);
            Logger.Trace("执行结果:url:{0},siteCode:{3},code:{1},msg{2}\n", url, r.Code, r.Msg, siteCode);
            return(r);
        }
Beispiel #4
0
        /// <summary>
        /// 保存时间线
        /// </summary>
        /// <param name="requst"></param>
        /// <returns></returns>
        public ResponseMessage <SaveClipResponse> SaveTimeLine(string usertoken, string path, string title, string contentid, EditorMediaJson requst, string siteCode = "")
        {
            ResponseMessage <SaveClipResponse> res = new ResponseMessage <SaveClipResponse>();
            string url = ApiContext.RenderApiUrl + "/entity/object/saveobjectinfo";

            if (requst != null && requst.tracks != null && requst.tracks.Count > 0)
            {
                foreach (var i in requst.tracks)
                {
                    if (i.trackEvents == null)
                    {
                        i.trackEvents = new List <TrackEvent>();
                    }
                }
            }
            SaveClipRequst r = new SaveClipRequst()
            {
                version = 0,
                type    = "biz_sobey_program",
                @object = new ClipObject()
                {
                    metadata       = null,
                    additionalinfo = null,
                    fileformatinfo = null,
                }
            };

            if (requst.resources != null && requst.resources.Count > 0)
            {
                [email protected] = new Entity()
                {
                    id             = "",
                    guid           = contentid,
                    type           = "64",
                    subtype        = 3,
                    folderid       = requst.resources[0].FolderID,
                    folderpath     = path,
                    cdid           = "0",
                    keyword        = "",
                    iconframe      = requst.resources[0].IconFrame,
                    iconfilename   = requst.resources[0].IconFileName,
                    creator        = null,
                    modifier       = null,
                    menber         = null,
                    Delater        = null,
                    createdate     = DateTime.UtcNow.ToString(),
                    modifydate     = DateTime.UtcNow.ToString(),
                    accessdate     = DateTime.UtcNow.ToString(),
                    deletedate     = DateTime.UtcNow.ToString(),
                    column         = null,
                    status         = "0",
                    usedflag       = "0",
                    lockflag       = "0",
                    rights         = "",
                    journallist    = "",
                    note           = "",
                    editterminal   = "",
                    modifyterminal = "",
                    deviceid       = "00000000000000000000000000000000",
                    markin         = "-1",
                    markout        = "-1",
                    colorspace     = null,
                    name           = title,
                    Item           = new Item()
                    {
                        fcpxml           = "",
                        projectdata      = JsonHelper.ToJson(requst),
                        Destination      = 0,
                        SubPgmguid       = 0,
                        audiochannel     = 8,
                        audioformatid    = 79,
                        audiotrack       = 4,
                        backpath         = "",
                        backtrack        = 0,
                        clippath         = "",
                        dubstatus        = 0,
                        edittime         = 0,
                        editversion      = 0,
                        filepath         = "",
                        forcerefreshflag = 0,
                        graphtrack       = 1,
                        length           = 0,
                        markpoints       = null,
                        savestate        = 0,
                        sysversion       = 6,
                        tlblock          = 0,
                        trimin           = 0,
                        trimout          = 0,
                        undopath         = "",
                        videoformatid    = 79,
                        videotrack       = 1,
                        vtrin            = 0,
                        vtrout           = 0
                    }
                };
            }
            else
            {
                [email protected] = new Entity()
                {
                    id             = null,
                    guid           = contentid,
                    type           = "64",
                    subtype        = 3,
                    folderid       = null,
                    folderpath     = path,
                    cdid           = "0",
                    keyword        = "",
                    iconframe      = null,
                    iconfilename   = null,
                    creator        = null,
                    modifier       = null,
                    menber         = null,
                    Delater        = null,
                    createdate     = DateTime.UtcNow.ToString(),
                    modifydate     = DateTime.UtcNow.ToString(),
                    accessdate     = DateTime.UtcNow.ToString(),
                    deletedate     = DateTime.UtcNow.ToString(),
                    column         = null,
                    status         = "0",
                    usedflag       = "0",
                    lockflag       = "0",
                    rights         = "",
                    journallist    = "",
                    note           = "",
                    editterminal   = "",
                    modifyterminal = "",
                    deviceid       = "00000000000000000000000000000000",
                    markin         = "-1",
                    markout        = "-1",
                    colorspace     = null,
                    name           = title,
                    Item           = new Item()
                    {
                        fcpxml           = "",
                        projectdata      = JsonHelper.ToJson(requst),
                        Destination      = 0,
                        SubPgmguid       = 0,
                        audiochannel     = 8,
                        audioformatid    = 79,
                        audiotrack       = 4,
                        backpath         = "",
                        backtrack        = 0,
                        clippath         = "",
                        dubstatus        = 0,
                        edittime         = 0,
                        editversion      = 0,
                        filepath         = "",
                        forcerefreshflag = 0,
                        graphtrack       = 1,
                        length           = 0,
                        markpoints       = null,
                        savestate        = 0,
                        sysversion       = 6,
                        tlblock          = 0,
                        trimin           = 0,
                        trimout          = 0,
                        undopath         = "",
                        videoformatid    = 79,
                        videotrack       = 1,
                        vtrin            = 0,
                        vtrout           = 0
                    }
                };
            }
            NameValueCollection q = new NameValueCollection();

            q.Add("usertoken", usertoken);
            q.Add("siteCode", siteCode);

            res = ApiContext.Client.Post <ResponseMessage <SaveClipResponse> >(url, r, "Post", q);
            Logger.Trace("执行结果:url:{0},siteCode:{4},code:{1},msg:{2},json:{3}\n", url, res.Code, res.Msg, JsonHelper.ToJson(r), siteCode);
            return(res);
        }