private List <VideoNode> LoadVideoFilePath() { List <VideoNode> VideoList = new List <VideoNode>(); VideoList = VideoJson.GetResource(); return(VideoList); }
private List <VideoNode> UpdateVersion() { List <VideoNode> VideoList = new List <VideoNode>(); if (File.Exists(filePath)) { File.Delete(filePath); } string result = HttpWebResponseUtility.CreateGetHttpResponse(AppConst.ResourcelistUrl, "", null, null, null, Encoding.UTF8, m_token); //UnityEngine.Debug.Log(result); using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite)) { using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8)) { sw.Write(result); } } if (File.Exists(filePath)) { VideoList = VideoJson.GetResource(); return(VideoList); } return(null); }
private List <VideoNode> CheckUpdateVersion(string ServerVersion) { List <VideoNode> VideoitemList = new List <VideoNode>(); string currentVersion = string.Empty; if (File.Exists(filePath)) { currentVersion = VideoJson.GetVersion(); if (currentVersion != ServerVersion) { //进行版本跟新 VideoitemList = UpdateVersion(); } else { //不需要跟新,检测本地文件,开始播放 VideoitemList = LoadVideoFilePath(); } } else { VideoitemList = UpdateVersion(); } return(VideoitemList); }