在这个项目中,我有一个从互联网上下载视频的协同程序
IEnumerator DownloadVideo(string video_download_link){
UnityWebRequest www = UnityWebRequest.Get(video_download_link);
yield return www.SendWebRequest();
string savePath = Application.temporaryCachePath + "/myVideo.mp4";
File.WriteAllBytes(savePath, www.downloadHandler.data);
yield return new WaitUntil(() => File.Exists(savePath));
videoPlayer.url = savePath;
videoPlayer.Prepare();
while(!videoPlayer.isPrepared) yield return null;
videoPlayer.Play();
}
视频似乎下载得很好,但在播放时,我得到:
得到
http://www.mywebsite.com/tmp/myVideo.mp4
net::ERR_中止404(未找到)
我做错什么了?我该怎么解决这个问题?