我有以下錯誤團結WWW「中止」的錯誤
當我嘗試下載與團結WWW類MP4文件它www.error只有「中止」錯誤消息未能
其怪異錯誤,它只出現在一些設備上,我已經在銀河注5上試過了,效果很好,當有人在銀河系s7上試過它時,他得到那個錯誤
任何一個mybe知道什麼是hapening?
感謝您的幫助球員。
代碼下載視頻
private IEnumerator DownloadVideo()
{
showDownloadProgress = true;
downloadProgress.gameObject.SetActive(true);
videoURL = MainPlayerCTRL.mediaURL;
Uri uri = new Uri(videoURL);
string filename = System.IO.Path.GetFileName(uri.LocalPath);
string localFilePath = Application.persistentDataPath + "/"+ filename;
bool tryVideoDownload = true;
if (!File.Exists(localFilePath))
{
while (tryVideoDownload)
{
downloadProgressText.text = "Downloading";
showDownloadProgress = true;
downloadProgress.gameObject.SetActive(true);
www = new WWW(videoURL);
yield return www;
if (String.IsNullOrEmpty(www.error))
{
byte[] bytes = www.bytes;
FileStream fs = new FileStream(localFilePath, FileMode.Create);
fs.Write(bytes, 0, bytes.Length);
downloadProgressText.text = "Download done!";
yield return new WaitForSeconds(2);
tryVideoDownload = false;
}//Video downloaded
else
{
showDownloadProgress = false;
downloadProgress.gameObject.SetActive(true);
downloadProgressText.text = "Download ERROR \n ";
downloadProgressText.text += www.error;
yield return new WaitForSeconds(2);
downloadProgressText.text = "Attempting to download again";
yield return new WaitForSeconds(2);
tryVideoDownload = true;
}
}
yield return new WaitForEndOfFrame();
}
}
視頻有多大?另外,它失敗的設備型號是什麼?這很可能是一個記憶問題。不知道所有這些信息。 – Programmer
視頻大小是250 MB,你認爲它可能是暫時的內存問題?智能手機的內部和外部存儲容量超過2GB。 –
'內部和外部存儲'!='Ram'。人們混淆了這兩個。我曾經遇到過這個問題,併爲它寫了一個解決方案。如果我在電腦上找到答案,我會回答。 – Programmer