/// <summary> /// 后端接口XML输出 /// </summary> /// <param name="video"></param> /// <returns></returns> public static XElement ResponseBack(VideoNode video) { var cname = video.Main.Name.Replace("#", " "); var flag = video.Flags.FormatListToStr(SplitArray.Line); var res = VideoUtils.FormatStrArray(10, video.Main.VideoWidth, "|", video.Main.VideoHeight); var v = new XElement("v", new XElement("vid", video.Main.ChannelID), new XElement("playlink", BoxUtils.GetXmlCData(CreatePlayLink(video))), new XElement("title", cname), new XElement("type", video.Type), new XElement("catalog", video.Language[CustomArray.LanguageArray[0]].CatalogTags), new XElement("director", video.BKInfo.Directors), new XElement("act", video.BKInfo.Actors), new XElement("year", video.YearTags), new XElement("area", video.Language[CustomArray.LanguageArray[0]].AreaTags), new XElement("imgurl", video.ResImage), new XElement("state", video.State), new XElement("note", BoxUtils.GetXmlCData(video.BKInfo.Introduction)), new XElement("mark", video.BKInfo.Score), new XElement("hot", video.BKInfo.Score), new XElement("bitrate", video.Main.BitRate), new XElement("resolution", res), new XElement("flag", flag), new XElement("duration", video.Main.TimeLength / 60), new XElement("online-time", video.Main.CreateTime.ToString("yyyy-MM-dd HH:mm:ss")), new XElement("last-update-time", video.Main.ModifyTime.ToString("yyyy-MM-dd HH:mm:ss")) ); return(v); }
public static void SetSlotImage(T video) { if (!string.IsNullOrEmpty(video.Main.Md5) && video.Main.Md5.Length > 3) { var slots = new string[4]; slots[0] = "http://m.img.pplive.cn/"; slots[1] = VideoUtils.FormatStrArray(8, video.Main.Md5[0], video.Main.Md5[1], "/", video.Main.Md5[2], video.Main.Md5[3], "/"); slots[2] = video.Main.Md5; slots[3] = "/1.jpg"; video.SlotImage = slots; } }